diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
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, | |||
1362 | printk(KERN_INFO "btrfs: resizing devid %llu\n", | 1362 | printk(KERN_INFO "btrfs: resizing devid %llu\n", |
1363 | (unsigned long long)devid); | 1363 | (unsigned long long)devid); |
1364 | } | 1364 | } |
1365 | |||
1365 | device = btrfs_find_device(root->fs_info, devid, NULL, NULL); | 1366 | device = btrfs_find_device(root->fs_info, devid, NULL, NULL); |
1366 | if (!device) { | 1367 | if (!device) { |
1367 | printk(KERN_INFO "btrfs: resizer unable to find device %llu\n", | 1368 | printk(KERN_INFO "btrfs: resizer unable to find device %llu\n", |
@@ -1369,9 +1370,10 @@ static noinline int btrfs_ioctl_resize(struct file *file, | |||
1369 | ret = -EINVAL; | 1370 | ret = -EINVAL; |
1370 | goto out_free; | 1371 | goto out_free; |
1371 | } | 1372 | } |
1372 | if (device->fs_devices && device->fs_devices->seeding) { | 1373 | |
1374 | if (!device->writeable) { | ||
1373 | printk(KERN_INFO "btrfs: resizer unable to apply on " | 1375 | printk(KERN_INFO "btrfs: resizer unable to apply on " |
1374 | "seeding device %llu\n", | 1376 | "readonly device %llu\n", |
1375 | (unsigned long long)devid); | 1377 | (unsigned long long)devid); |
1376 | ret = -EINVAL; | 1378 | ret = -EINVAL; |
1377 | goto out_free; | 1379 | goto out_free; |