Skip to content

Commit b0b595e

Browse files
adam900710kdave
authored andcommitted
btrfs: tree-checker: fix the wrong output of data backref objectid
[BUG] There are some reports about invalid data backref objectids, the report looks like this: BTRFS critical (device sda): corrupt leaf: block=333654787489792 slot=110 extent bytenr=333413935558656 len=65536 invalid data ref objectid value 2543 The data ref objectid is the inode number inside the subvolume. But in above case, the value is completely sane, not really showing the problem. [CAUSE] The root cause of the problem is the deprecated feature, inode cache. This feature results a special inode number, -12ULL, and it's no longer recognized by tree-checker, triggering the error. The direct problem here is the output of data ref objectid. The value shown is in fact the dref_root (subvolume id), not the dref_objectid (inode number). [FIX] Fix the output to use dref_objectid instead. Reported-by: Neil Parton <[email protected]> Reported-by: Archange <[email protected]> Link: https://lore.kernel.org/linux-btrfs/CAAYHqBbrrgmh6UmW3ANbysJX9qG9Pbg3ZwnKsV=5mOpv_qix_Q@mail.gmail.com/ Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Fixes: f333a3c ("btrfs: tree-checker: validate dref root and objectid") CC: [email protected] # 6.11 Reviewed-by: Filipe Manana <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 7ee85f5 commit b0b595e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/tree-checker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ static int check_extent_item(struct extent_buffer *leaf,
15171517
dref_objectid > BTRFS_LAST_FREE_OBJECTID)) {
15181518
extent_err(leaf, slot,
15191519
"invalid data ref objectid value %llu",
1520-
dref_root);
1520+
dref_objectid);
15211521
return -EUCLEAN;
15221522
}
15231523
if (unlikely(!IS_ALIGNED(dref_offset,

0 commit comments

Comments
 (0)