Btrfs: fix wrong error returned by adding a device
authorLiu Bo <liubo2009@cn.fujitsu.com>
Thu, 10 May 2012 10:10:38 +0000 (18:10 +0800)
committerJosef Bacik <josef@redhat.com>
Wed, 30 May 2012 14:23:34 +0000 (10:23 -0400)
commitf8c5d0b443ff87c43ba690fa2b5bd2c9387d8624
tree683da2f43916956f87551de7e806e69d0663ee1d
parent5fd02043553b02867b29de1ac9fff2ec16b84def
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>
fs/btrfs/volumes.c