Commit bd5c39ed authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

loop: reduce loop_ctl_mutex coverage in loop_exit

loop_ctl_mutex is only needed to iterate the IDR for removing the loop
devices, so reduce the coverage.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Link: https://lore.kernel.org/r/20210623145908.92973-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8b52d8be
...@@ -2549,13 +2549,14 @@ static int loop_exit_cb(int id, void *ptr, void *data) ...@@ -2549,13 +2549,14 @@ static int loop_exit_cb(int id, void *ptr, void *data)
static void __exit loop_exit(void) static void __exit loop_exit(void)
{ {
mutex_lock(&loop_ctl_mutex);
unregister_blkdev(LOOP_MAJOR, "loop"); unregister_blkdev(LOOP_MAJOR, "loop");
misc_deregister(&loop_misc); misc_deregister(&loop_misc);
mutex_lock(&loop_ctl_mutex);
idr_for_each(&loop_index_idr, &loop_exit_cb, NULL); idr_for_each(&loop_index_idr, &loop_exit_cb, NULL);
idr_destroy(&loop_index_idr);
mutex_unlock(&loop_ctl_mutex); mutex_unlock(&loop_ctl_mutex);
idr_destroy(&loop_index_idr);
} }
module_init(loop_init); module_init(loop_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment