From 7e042abee8c365203f8379682b66dfd6dafa74a5 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Wed, 20 Mar 2019 14:27:40 +0800 Subject: [PATCH] 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 --- fs/btrfs/disk-io.c | 4 ++++ 1 file changed, 4 insertions(+) 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)) -- 2.39.5