Btrfs: do not resize a seeding device
authorLiu Bo <liubo2009@cn.fujitsu.com>
Thu, 14 Jun 2012 08:23:19 +0000 (02:23 -0600)
committerChris Mason <chris.mason@fusionio.com>
Fri, 15 Jun 2012 15:42:26 +0000 (11:42 -0400)
Seeding devices are not supposed to change any more.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c

index a98f7d252829aa14ef6c530885d7dadc98f5bb12..58adbd0356d6ef93c301ff2780bb79564d150fa8 100644 (file)
@@ -1306,6 +1306,13 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
                ret = -EINVAL;
                goto out_free;
        }
+       if (device->fs_devices && device->fs_devices->seeding) {
+               printk(KERN_INFO "btrfs: resizer unable to apply on "
+                      "seeding device %llu\n", devid);
+               ret = -EINVAL;
+               goto out_free;
+       }
+
        if (!strcmp(sizestr, "max"))
                new_size = device->bdev->bd_inode->i_size;
        else {