summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorLiu Bo2012-05-10 12:10:38 +0200
committerJosef Bacik2012-05-30 16:23:34 +0200
commitf8c5d0b443ff87c43ba690fa2b5bd2c9387d8624 (patch)
tree683da2f43916956f87551de7e806e69d0663ee1d /fs/btrfs/volumes.c
parentBtrfs: finish ordered extents in their own thread (diff)
downloadkernel-qcow2-linux-f8c5d0b443ff87c43ba690fa2b5bd2c9387d8624.tar.gz
kernel-qcow2-linux-f8c5d0b443ff87c43ba690fa2b5bd2c9387d8624.tar.xz
kernel-qcow2-linux-f8c5d0b443ff87c43ba690fa2b5bd2c9387d8624.zip
Btrfs: fix wrong error returned by adding a device
Reproduce: $ mkfs.btrfs /dev/sdb7 $ mount /dev/sdb7 /mnt/btrfs -o ro $ btrfs dev add /dev/sdb8 /mnt/btrfs ERROR: error adding the device '/dev/sdb8' - Invalid argument Since we mount with readonly options, and /dev/sdb7 is not a seeding one, a readonly notification is preferred. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> Reviewed-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1411b99555a4..48a06d1fc067 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1633,7 +1633,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
int ret = 0;
if ((sb->s_flags & MS_RDONLY) && !root->fs_info->fs_devices->seeding)
- return -EINVAL;
+ return -EROFS;
bdev = blkdev_get_by_path(device_path, FMODE_WRITE | FMODE_EXCL,
root->fs_info->bdev_holder);