Explorar o código

Btrfs: fix a scrub regression in case of write errors

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>
Stefan Behrens %!s(int64=12) %!d(string=hai) anos
pai
achega
af1be4f851
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      fs/btrfs/scrub.c

+ 2 - 1
fs/btrfs/scrub.c

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