]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Btrfs: fix a scrub regression in case of write errors
authorStefan Behrens <sbehrens@giantdisaster.de>
Tue, 27 Nov 2012 17:39:51 +0000 (17:39 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:14 +0000 (20:46 -0500)
This regression was introduced by the device-replace patches.
Scrub immediately stops checking those disks that have write errors.
This is nothing that happens in the real world, but it is wrong
since scrub is the tool to detect and repair defects. Fix it.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/scrub.c

index 30ba99724896cc279a2ea5d1111c39e32384c1fb..8db6a6413a5fdee2974103500e24acfb9e24e221 100644 (file)
@@ -2657,7 +2657,8 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
                btrfs_put_block_group(cache);
                if (ret)
                        break;
-               if (atomic64_read(&dev_replace->num_write_errors) > 0) {
+               if (is_dev_replace &&
+                   atomic64_read(&dev_replace->num_write_errors) > 0) {
                        ret = -EIO;
                        break;
                }