aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-08-25 09:31:40 -0400
committerChris Mason <clm@fb.com>2015-11-10 22:26:57 -0500
commit9799d2c32bef6fba098fbef763002bc8d4851a2c (patch)
tree0a5ea8993a9a360fca496c64c8f23391d3967983
parentf1cd1f0b7d1b5d4aaa5711e8f4e4898b0045cb6d (diff)
btrfs: scrub: set error stats when tree block spanning stripes
It is better to show error stats to user when we found tree block spanning stripes. On a btrfs created by old version of btrfs-convert: Before patch: # btrfs scrub start -B /dev/vdh scrub done for 8b342d35-2904-41ab-b3cb-2f929709cf47 scrub started at Tue Aug 25 21:19:09 2015 and finished after 00:00:00 total bytes scrubbed: 53.54MiB with 0 errors # dmesg ... [ 128.711434] BTRFS error (device vdh): scrub: tree block 27054080 spanning stripes, ignored. logical=27000832 [ 128.712744] BTRFS error (device vdh): scrub: tree block 27054080 spanning stripes, ignored. logical=27066368 ... After patch: # btrfs scrub start -B /dev/vdh scrub done for ff7f844b-7a4e-4b1a-88a9-8252ab25be1b scrub started at Tue Aug 25 21:42:29 2015 and finished after 00:00:00 total bytes scrubbed: 53.60MiB with 2 errors error details: corrected errors: 0, uncorrectable errors: 2, unverified errors: 0 ERROR: There are uncorrectable errors. # dmesg ...omit... # Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r--fs/btrfs/scrub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 550de89a8661..3e2755eb0f08 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3012,6 +3012,9 @@ static noinline_for_stack int scrub_raid56_parity(struct scrub_ctx *sctx,
3012 logic_start + map->stripe_len)) { 3012 logic_start + map->stripe_len)) {
3013 btrfs_err(fs_info, "scrub: tree block %llu spanning stripes, ignored. logical=%llu", 3013 btrfs_err(fs_info, "scrub: tree block %llu spanning stripes, ignored. logical=%llu",
3014 key.objectid, logic_start); 3014 key.objectid, logic_start);
3015 spin_lock(&sctx->stat_lock);
3016 sctx->stat.uncorrectable_errors++;
3017 spin_unlock(&sctx->stat_lock);
3015 goto next; 3018 goto next;
3016 } 3019 }
3017again: 3020again:
@@ -3361,6 +3364,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
3361 "scrub: tree block %llu spanning " 3364 "scrub: tree block %llu spanning "
3362 "stripes, ignored. logical=%llu", 3365 "stripes, ignored. logical=%llu",
3363 key.objectid, logical); 3366 key.objectid, logical);
3367 spin_lock(&sctx->stat_lock);
3368 sctx->stat.uncorrectable_errors++;
3369 spin_unlock(&sctx->stat_lock);
3364 goto next; 3370 goto next;
3365 } 3371 }
3366 3372