loop: implement ->free_disk
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Mar 2022 05:29:13 +0000 (07:29 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 12:54:09 +0000 (06:54 -0600)
commitd2c7f56f8b5256d57f9e3fc7794c31361d43bdd9
tree8a69890c7767a4731edda8ba4730806f2e78a441
parent1fe0b1acb14dd3113b7dc975a118cd7f08af8316
loop: implement ->free_disk

Ensure that the lo_device which is stored in the gendisk private
data is valid until the gendisk is freed.  Currently the loop driver
uses a lot of effort to make sure a device is not freed when it is
still in use, but to to fix a potential deadlock this will be relaxed
a bit soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220330052917.2566582-12-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c