Skip to content

Commit 6d06b0a

Browse files
committed
btrfs: tree-checker: add missing returns after data_ref alignment checks
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: [email protected] # 5.4+ Fixes: 0785a9a ("btrfs: tree-checker: Add EXTENT_DATA_REF check") Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0697d9a commit 6d06b0a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/tree-checker.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
14241424
"invalid item size, have %u expect aligned to %zu for key type %u",
14251425
btrfs_item_size_nr(leaf, slot),
14261426
sizeof(*dref), key->type);
1427+
return -EUCLEAN;
14271428
}
14281429
if (!IS_ALIGNED(key->objectid, leaf->fs_info->sectorsize)) {
14291430
generic_err(leaf, slot,
@@ -1452,6 +1453,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
14521453
extent_err(leaf, slot,
14531454
"invalid extent data backref offset, have %llu expect aligned to %u",
14541455
offset, leaf->fs_info->sectorsize);
1456+
return -EUCLEAN;
14551457
}
14561458
}
14571459
return 0;

0 commit comments

Comments
 (0)