diff options
author | Qu Wenruo | 2017-02-09 10:45:06 +0800 |
---|---|---|
committer | David Sterba | 2017-02-17 12:03:48 +0100 |
commit | 6f6b643e44ef79cbd85e69800a06326805829aa8 (patch) | |
tree | 7d04cfdabebaa9da49fc5f36c83024e7d882fbb7 /fs/btrfs/inode.c | |
parent | fe01aa65385c226d822013b90608b67c485f8dc6 (diff) |
btrfs: Better csum error message for data csum mismatch
The original csum error message only outputs inode number, offset, check
sum and expected check sum.
However no root objectid is outputted, which sometimes makes debugging
quite painful under multi-subvolume case (including relocation).
Also the checksum output is decimal, which seldom makes sense for
users/developers and is hard to read in most time.
This patch will add root objectid, which will be %lld for rootid larger
than LAST_FREE_OBJECTID, and hex csum output for better readability.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 92416f3ea9a8..175c28a94a57 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3086,9 +3086,8 @@ static int __readpage_endio_check(struct inode *inode, kunmap_atomic(kaddr); return 0; zeroit: - btrfs_warn_rl(BTRFS_I(inode)->root->fs_info, - "csum failed ino %llu off %llu csum %u expected csum %u", - btrfs_ino(BTRFS_I(inode)), start, csum, csum_expected); + btrfs_print_data_csum_error(inode, start, csum, csum_expected, + io_bio->mirror_num); memset(kaddr + pgoff, 1, len); flush_dcache_page(page); kunmap_atomic(kaddr); |