diff options
author | Christoph Hellwig <hch@lst.de> | 2022-03-30 07:29:16 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 06:54:09 -0600 |
commit | a0e286b6a5b61d4da01bdf865071c4da417046d6 (patch) | |
tree | 3bc885d95283578b71c3750935e1d8d3bf3604c2 /drivers/block/loop.h | |
parent | 158eaeba4b8edf9940f64daa83cbd1ac7db7593c (diff) | |
download | linux-a0e286b6a5b61d4da01bdf865071c4da417046d6.tar.gz linux-a0e286b6a5b61d4da01bdf865071c4da417046d6.tar.bz2 linux-a0e286b6a5b61d4da01bdf865071c4da417046d6.zip |
loop: remove lo_refcount and avoid lo_mutex in ->open / ->release
lo_refcount counts how many openers a loop device has, but that count
is already provided by the block layer in the bd_openers field of the
whole-disk block_device. Remove lo_refcount and allow opens to
succeed even on devices beeing deleted - now that ->free_disk is
implemented we can handle that race gracefull and all I/O on it will
just fail. Similarly there is a small race window now where
loop_control_remove does not synchronize the delete vs the remove
due do bd_openers not being under lo_mutex protection, but we can
handle that just as gracefully.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220330052917.2566582-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/loop.h')
-rw-r--r-- | drivers/block/loop.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/block/loop.h b/drivers/block/loop.h index 082d4b6bfc6a..449d562738c5 100644 --- a/drivers/block/loop.h +++ b/drivers/block/loop.h @@ -28,7 +28,6 @@ struct loop_func_table; struct loop_device { int lo_number; - atomic_t lo_refcnt; loff_t lo_offset; loff_t lo_sizelimit; int lo_flags; |