btrfs: scrub: return EAGAIN when fs is closing
authorDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 18:57:41 +0000 (19:57 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:17 +0000 (19:02 +0200)
The error code used here is wrong as it's not invalid to try to start
scrub when umount has begun.  Returning EAGAIN is more user friendly as
it's recoverable.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c

index a99588536c79e5fcbdbef4caf6a86852ea83205c..ed471ffbf115a3c2bc294d6a74c6d7a32ce8672f 100644 (file)
@@ -3791,7 +3791,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
        struct btrfs_workqueue *scrub_parity = NULL;
 
        if (btrfs_fs_closing(fs_info))
-               return -EINVAL;
+               return -EAGAIN;
 
        if (fs_info->nodesize > BTRFS_STRIPE_LEN) {
                /*