mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
btrfs: tree-checker: add missing returns after data_ref alignment checks
commit6d06b0ad94upstream. There are sectorsize alignment checks that are reported but then check_extent_data_ref continues. This was not intended, wrong alignment is not a minor problem and we should return with error. CC: stable@vger.kernel.org # 5.4+ Fixes:0785a9aacf("btrfs: tree-checker: Add EXTENT_DATA_REF check") Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0115a26133
commit
12aedea582
@@ -1269,6 +1269,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
|
||||
"invalid item size, have %u expect aligned to %zu for key type %u",
|
||||
btrfs_item_size_nr(leaf, slot),
|
||||
sizeof(*dref), key->type);
|
||||
return -EUCLEAN;
|
||||
}
|
||||
if (!IS_ALIGNED(key->objectid, leaf->fs_info->sectorsize)) {
|
||||
generic_err(leaf, slot,
|
||||
@@ -1297,6 +1298,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
|
||||
extent_err(leaf, slot,
|
||||
"invalid extent data backref offset, have %llu expect aligned to %u",
|
||||
offset, leaf->fs_info->sectorsize);
|
||||
return -EUCLEAN;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user