diff options
author | Christoph Hellwig <hch@lst.de> | 2020-11-16 15:56:53 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-11-16 08:34:14 -0700 |
commit | 3b4f85d02a4bd85cbea999a064235a47694bbb7b (patch) | |
tree | b178420e56a53b32eb23554fccbe4338bce183e9 /drivers/block/loop.c | |
parent | 99473d9db93a3bf557161373a1eb33d2873edd2e (diff) | |
download | linux-stable-3b4f85d02a4bd85cbea999a064235a47694bbb7b.tar.gz linux-stable-3b4f85d02a4bd85cbea999a064235a47694bbb7b.tar.bz2 linux-stable-3b4f85d02a4bd85cbea999a064235a47694bbb7b.zip |
loop: let set_capacity_revalidate_and_notify update the bdev size
There is no good reason to call revalidate_disk_size separately.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r-- | drivers/block/loop.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 22e59410b971..fcc5e32f0993 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -251,12 +251,8 @@ loop_validate_block_size(unsigned short bsize) */ static void loop_set_size(struct loop_device *lo, loff_t size) { - struct block_device *bdev = lo->lo_device; - - bd_set_nr_sectors(bdev, size); - - if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, false)) - kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); + if (!set_capacity_revalidate_and_notify(lo->lo_disk, size, true)) + kobject_uevent(&disk_to_dev(lo->lo_disk)->kobj, KOBJ_CHANGE); } static inline int |