Btrfs: do not resize a seeding device

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>
This commit is contained in:
Liu Bo 2012-06-14 02:23:19 -06:00 committed by Chris Mason
parent bc1782374b
commit 4e42ae1bdc
1 changed files with 7 additions and 0 deletions

View File

@ -1306,6 +1306,13 @@ static noinline int btrfs_ioctl_resize(struct btrfs_root *root,
ret = -EINVAL; ret = -EINVAL;
goto out_free; 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")) if (!strcmp(sizestr, "max"))
new_size = device->bdev->bd_inode->i_size; new_size = device->bdev->bd_inode->i_size;
else { else {