This is a note to let you know that I've just added the patch titled loop: let set_capacity_revalidate_and_notify update the bdev size to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: loop-let-set_capacity_revalidate_and_notify-update-t.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 549838e515708f8ed50c9c55cb15965698642aaf Author: Christoph Hellwig <hch@xxxxxx> Date: Mon Nov 16 15:56:53 2020 +0100 loop: let set_capacity_revalidate_and_notify update the bdev size [ Upstream commit 3b4f85d02a4bd85cbea999a064235a47694bbb7b ] There is no good reason to call revalidate_disk_size separately. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Hannes Reinecke <hare@xxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Stable-dep-of: 74363ec674cb ("zram: fix uninitialized ZRAM not releasing backing device") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 7444cc2a6c86..198f7ce3234b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -238,12 +238,8 @@ static void __loop_update_dio(struct loop_device *lo, bool dio) */ 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