From: Qu Wenruo Date: Wed, 20 Mar 2019 06:27:40 +0000 (+0800) Subject: btrfs: disk-io: Show the timing of corrupted tree block explicitly X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=75391f0d41197e54b61ada92ddeffc28bf028c8c;p=linux.git btrfs: disk-io: Show the timing of corrupted tree block explicitly Just add one extra line to show when the corruption is detected. Currently only read time detection is possible. The planned distinguish line would be: read time: block=XXXXX read time tree block corruption detected write time: block=XXXXX write time tree block corruption detected Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index fb9c9e0783afb..f4ef3a1a321b2 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -662,6 +662,10 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio, if (!ret) set_extent_buffer_uptodate(eb); + else + btrfs_err(fs_info, + "block=%llu read time tree block corruption detected", + eb->start); err: if (reads_done && test_and_clear_bit(EXTENT_BUFFER_READAHEAD, &eb->bflags))