aboutsummaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorGravatar Christoph Hellwig <hch@lst.de> 2021-07-22 09:54:00 +0200
committerGravatar Jens Axboe <axboe@kernel.dk> 2021-08-02 13:37:28 -0600
commit4b2731226d7de4302e4d8766c86e3a21c56dc3b1 (patch)
tree5821bdb9b3ebf9007cc43f7ce6790499c06de302 /drivers/block
parentblock: change the refcounting for partitions (diff)
downloadlinux-4b2731226d7de4302e4d8766c86e3a21c56dc3b1.tar.gz
linux-4b2731226d7de4302e4d8766c86e3a21c56dc3b1.tar.bz2
linux-4b2731226d7de4302e4d8766c86e3a21c56dc3b1.zip
loop: don't grab a reference to the block device
The whole device block device won't be removed while the disk is still alive, so don't bother to grab a reference to it. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Ming Lei <ming.lei@rehat.com> Reviewed-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com> Link: https://lore.kernel.org/r/20210722075402.983367-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/loop.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index f0cdff0c5fbf..a03ef5025f27 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1304,10 +1304,6 @@ static int loop_configure(struct loop_device *lo, fmode_t mode,
if (partscan)
lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
- /* Grab the block_device to prevent its destruction after we
- * put /dev/loopXX inode. Later in __loop_clr_fd() we bdput(bdev).
- */
- bdgrab(bdev);
loop_global_unlock(lo, is_loop);
if (partscan)
loop_reread_partitions(lo);
@@ -1398,7 +1394,6 @@ static int __loop_clr_fd(struct loop_device *lo, bool release)
blk_queue_physical_block_size(lo->lo_queue, 512);
blk_queue_io_min(lo->lo_queue, 512);
if (bdev) {
- bdput(bdev);
invalidate_bdev(bdev);
bdev->bd_inode->i_mapping->wb_err = 0;
}