Commit 33ef30add16905f99bbe799ee5ccea15ba497803

Authored by Ilya Dryomov
Committed by Chris Mason
1 parent d006a04816

Btrfs: do not inc uncorrectable_errors counter on ro scrubs

Currently if we discover an error when scrubbing in ro mode we a)
blindly increment the uncorrectable_errors counter, and b) spam the
dmesg with the 'unable to fixup (regular) error at ...' message, even
though a) we haven't tried to determine if the error is correctable or
not, and b) we haven't tried to fixup anything.  Fix this.

Cc: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

... ... @@ -938,8 +938,10 @@
938 938 BTRFS_DEV_STAT_CORRUPTION_ERRS);
939 939 }
940 940  
941   - if (sctx->readonly && !sctx->is_dev_replace)
942   - goto did_not_correct_error;
  941 + if (sctx->readonly) {
  942 + ASSERT(!sctx->is_dev_replace);
  943 + goto out;
  944 + }
943 945  
944 946 if (!is_metadata && !have_csum) {
945 947 struct scrub_fixup_nodatasum *fixup_nodatasum;