btrfs: silence warning if replace is canceled
[sfrench/cifs-2.6.git] / fs / btrfs / dev-replace.c
index 85d93bd3b27a0505dd4277fc4b07f85ae80c56a9..ead4f380352744f275c799637790b8b7bf242057 100644 (file)
@@ -503,7 +503,7 @@ static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
        ret = btrfs_dev_replace_finishing(fs_info, ret);
        if (ret == -EINPROGRESS) {
                ret = BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS;
-       } else {
+       } else if (ret != -ECANCELED) {
                WARN_ON(ret);
        }
 
@@ -966,7 +966,7 @@ static int btrfs_dev_replace_kthread(void *data)
                              btrfs_device_get_total_bytes(dev_replace->srcdev),
                              &dev_replace->scrub_progress, 0, 1);
        ret = btrfs_dev_replace_finishing(fs_info, ret);
-       WARN_ON(ret);
+       WARN_ON(ret && ret != -ECANCELED);
 
        clear_bit(BTRFS_FS_EXCL_OP, &fs_info->flags);
        return 0;