diff options
author | Anand Jain <anand.jain@oracle.com> | 2018-11-11 17:22:24 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 16:51:35 +0300 |
commit | 53e62fb5a4aedeff05aa1efd277de32dc765f4bf (patch) | |
tree | 108451ec04b515f5e429a4a48b8d1ff2a5fbfd66 /fs/btrfs/dev-replace.c | |
parent | fe97e2e173afb61f1bb889c45f9597102c9f4849 (diff) | |
download | linux-53e62fb5a4aedeff05aa1efd277de32dc765f4bf.tar.xz |
btrfs: dev-replace: add explicit check for replace result "no error"
We recast the replace return status
BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS to 0, to indicate no
error.
And since BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR should also return 0,
which is also declared as 0, so we just return. Instead add it to the if
statement so that there is enough clarity while reading the code.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r-- | fs/btrfs/dev-replace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index a84affa425d4..85d93bd3b27a 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c @@ -539,8 +539,9 @@ int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info, args->start.cont_reading_from_srcdev_mode); args->result = ret; /* don't warn if EINPROGRESS, someone else might be running scrub */ - if (ret == BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS) - ret = 0; + if (ret == BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS || + ret == BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) + return 0; return ret; } |