diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/loop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 7f8065392064..ed850366f22d 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1092,8 +1092,13 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info) if (lo->lo_offset != info->lo_offset || lo->lo_sizelimit != info->lo_sizelimit) { + struct block_device *bdev = lo->lo_device; + if (figure_loop_size(lo, info->lo_offset, info->lo_sizelimit)) return -EFBIG; + + bd_set_size(bdev, (loff_t)get_capacity(bdev->bd_disk) << 9); + kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); } loop_config_discard(lo); |