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:
    <detail report>
    block=XXXXX read time tree block corruption detected

  write time:
    <detail report>
    block=XXXXX write time tree block corruption detected

Signed-off-by: Qu Wenruo <w...@suse.com>
Reviewed-by: Nikolay Borisov <nbori...@suse.com>
Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de>
---
 fs/btrfs/disk-io.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 794d5bb7fe33..6052ab508f84 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -671,6 +671,9 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio 
*io_bio,
                 */
                atomic_inc(&eb->io_pages);
                clear_extent_buffer_uptodate(eb);
+               btrfs_err(fs_info,
+                         "block=%llu read time tree block corruption detected",
+                         eb->start);
        }
        free_extent_buffer(eb);
 out:
-- 
2.20.1

Reply via email to