btrfs: replace EINVAL with EOPNOTSUPP for dev_replace raid56
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 5 Jun 2014 02:02:51 +0000 (10:02 +0800)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:21:12 +0000 (17:21 -0700)
To return EOPNOTSUPP is more user friendly than to return EINVAL,
and then user-space tool will show that the dev_replace operation
for raid56 is not currently supported rather than showing that
there is an invalid argument.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/dev-replace.c

index 9f2290509acaeb105e3097831be8401b9a659dbe..2af6e66fe78894b7772d42d1160233459408cb07 100644 (file)
@@ -313,7 +313,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
 
        if (btrfs_fs_incompat(fs_info, RAID56)) {
                btrfs_warn(fs_info, "dev_replace cannot yet handle RAID5/RAID6");
-               return -EINVAL;
+               return -EOPNOTSUPP;
        }
 
        switch (args->start.cont_reading_from_srcdev_mode) {