Btrfs: do not inc uncorrectable_errors counter on ro scrubs

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:03 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=33ef30add16905f99bbe799ee5ccea15ba497803
Commit:     33ef30add16905f99bbe799ee5ccea15ba497803
Parent:     d006a04816a306995cd9d394079652a7462f81f8
Author:     Ilya Dryomov <idryomov at gmail.com>
AuthorDate: Sun Nov 3 19:06:38 2013 +0200
Committer:  Chris Mason <chris.mason at fusionio.com>
CommitDate: Wed Nov 20 20:41:38 2013 -0500

    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 at giantdisaster.de>
    Signed-off-by: Ilya Dryomov <idryomov at gmail.com>
    Signed-off-by: Josef Bacik <jbacik at fusionio.com>
    Signed-off-by: Chris Mason <chris.mason at fusionio.com>
---
 fs/btrfs/scrub.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 2544805..561e2f1 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -938,8 +938,10 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
 				BTRFS_DEV_STAT_CORRUPTION_ERRS);
 	}
 
-	if (sctx->readonly && !sctx->is_dev_replace)
-		goto did_not_correct_error;
+	if (sctx->readonly) {
+		ASSERT(!sctx->is_dev_replace);
+		goto out;
+	}
 
 	if (!is_metadata && !have_csum) {
 		struct scrub_fixup_nodatasum *fixup_nodatasum;



More information about the linux-mtd-cvs mailing list