summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiao Xie2012-12-21 10:19:51 +0100
committerJosef Bacik2013-01-14 19:52:49 +0100
commitdba60f3f5d564167118cad151a7d41dfe8d2a5f7 (patch)
treeac27d2c6b3797a2f52cc5d34ca1d570684db3be6 /fs
parentBtrfs: do not delete a subvolume which is in a R/O subvolume (diff)
downloadkernel-qcow2-linux-dba60f3f5d564167118cad151a7d41dfe8d2a5f7.tar.gz
kernel-qcow2-linux-dba60f3f5d564167118cad151a7d41dfe8d2a5f7.tar.xz
kernel-qcow2-linux-dba60f3f5d564167118cad151a7d41dfe8d2a5f7.zip
Btrfs: fix resize a readonly device
We should not resize a readonly device, fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 5a72896bd769..0de21213d05d 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1362,6 +1362,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
printk(KERN_INFO "btrfs: resizing devid %llu\n",
(unsigned long long)devid);
}
+
device = btrfs_find_device(root->fs_info, devid, NULL, NULL);
if (!device) {
printk(KERN_INFO "btrfs: resizer unable to find device %llu\n",
@@ -1369,9 +1370,10 @@ static noinline int btrfs_ioctl_resize(struct file *file,
ret = -EINVAL;
goto out_free;
}
- if (device->fs_devices && device->fs_devices->seeding) {
+
+ if (!device->writeable) {
printk(KERN_INFO "btrfs: resizer unable to apply on "
- "seeding device %llu\n",
+ "readonly device %llu\n",
(unsigned long long)devid);
ret = -EINVAL;
goto out_free;