diff options
author | Qu Wenruo <quwenruo.btrfs@gmx.com> | 2017-10-09 04:51:05 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-30 14:27:59 +0300 |
commit | d508c5f07cd6a6570947e980a598674fa34406dc (patch) | |
tree | 07499de97318018071ce7c9f7b85de7ca7d0027e /fs/btrfs | |
parent | 478d01b3fcf04f35aa33226637fe0becf6a35183 (diff) | |
download | linux-d508c5f07cd6a6570947e980a598674fa34406dc.tar.xz |
btrfs: tree-checker: Enhance output for check_csum_item
Output the bad value and expected good value (or its alignment).
Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
[ unindent long strings ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/tree-checker.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index b507c320eff5..3d1ae839a367 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -161,15 +161,21 @@ static int check_csum_item(struct btrfs_root *root, struct extent_buffer *leaf, u32 csumsize = btrfs_super_csum_size(root->fs_info->super_copy); if (key->objectid != BTRFS_EXTENT_CSUM_OBJECTID) { - CORRUPT("invalid objectid for csum item", leaf, root, slot); + generic_err(root, leaf, slot, + "invalid key objectid for csum item, have %llu expect %llu", + key->objectid, BTRFS_EXTENT_CSUM_OBJECTID); return -EUCLEAN; } if (!IS_ALIGNED(key->offset, sectorsize)) { - CORRUPT("unaligned key offset for csum item", leaf, root, slot); + generic_err(root, leaf, slot, + "unaligned key offset for csum item, have %llu should be aligned to %u", + key->offset, sectorsize); return -EUCLEAN; } if (!IS_ALIGNED(btrfs_item_size_nr(leaf, slot), csumsize)) { - CORRUPT("unaligned csum item size", leaf, root, slot); + generic_err(root, leaf, slot, + "unaligned item size for csum item, have %u should be aligned to %u", + btrfs_item_size_nr(leaf, slot), csumsize); return -EUCLEAN; } return 0; |