btrfs: dev-replace: set result code of cancel by status of scrub
authorAnand Jain <anand.jain@oracle.com>
Sun, 11 Nov 2018 14:22:20 +0000 (22:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:35 +0000 (14:51 +0100)
commitb47dda2ef6d793b67fd5979032dcd106e3f0a5c9
tree47982c73533db45975fedbee41d9b72a3a4879e2
parentd189dd70e2556181732598956d808ea53cc8774e
btrfs: dev-replace: set result code of cancel by status of scrub

The device-replace needs to check the result code of the scrub workers
in btrfs_dev_replace_cancel and distinguish if successful cancel
operation and when the there was no operation running.

If btrfs_scrub_cancel() fails, return
BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED so that user can try
to cancel the replace again.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c