Skip to content

Commit a2cea67

Browse files
fdmananakdave
authored andcommitted
btrfs: print extent buffers when sibling keys check fails
When trying to move keys from one node/leaf to another sibling node/leaf, if the sibling keys check fails we just print an error message with the last key of the left sibling and the first key of the right sibling. However it's also useful to print all the keys of each sibling, as it may provide some clues to what went wrong, which code path may be inserting keys in an incorrect order. So just do that, print the siblings with btrfs_print_tree(), as it works for both leaves and nodes. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9ae5afd commit a2cea67

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/btrfs/ctree.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,10 @@ static bool check_sibling_keys(struct extent_buffer *left,
26272627
}
26282628

26292629
if (btrfs_comp_cpu_keys(&left_last, &right_first) >= 0) {
2630+
btrfs_crit(left->fs_info, "left extent buffer:");
2631+
btrfs_print_tree(left, false);
2632+
btrfs_crit(left->fs_info, "right extent buffer:");
2633+
btrfs_print_tree(right, false);
26302634
btrfs_crit(left->fs_info,
26312635
"bad key order, sibling blocks, left last (%llu %u %llu) right first (%llu %u %llu)",
26322636
left_last.objectid, left_last.type,

0 commit comments

Comments
 (0)