OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:21 +0000 (09:20 +0100)
commitd87ca19cc574fff6d3bba2cb164c96e299db15dc
tree72cfd2454cee80798a1bc663ebfa70e5d4324408
parent37410d6a7e4c7d0c469e9b5c8dc9611cbb17b8da
btrfs: dev-replace: set result code of cancel by status of scrub

[ Upstream commit b47dda2ef6d793b67fd5979032dcd106e3f0a5c9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/dev-replace.c