Use set_capacity_and_notify to set the size of both the disk and block
device.  This also gets the uevent notifications for the resize for free.

Signed-off-by: Christoph Hellwig <h...@lst.de>
---
 drivers/block/pktcdvd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 467dbd06b7cdb1..4326401cede445 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2130,8 +2130,7 @@ static int pkt_open_dev(struct pktcdvd_device *pd, 
fmode_t write)
        }
 
        set_capacity(pd->disk, lba << 2);
-       set_capacity(pd->bdev->bd_disk, lba << 2);
-       bd_set_nr_sectors(pd->bdev, lba << 2);
+       set_capacity_and_notify(pd->bdev->bd_disk, lba << 2);
 
        q = bdev_get_queue(pd->bdev);
        if (write) {
-- 
2.29.2

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to