]> git.baikalelectronics.ru Git - kernel.git/commit
brd: reduce the brd_devices_mutex scope
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Tue, 7 Sep 2021 10:18:00 +0000 (19:18 +0900)
committerJens Axboe <axboe@kernel.dk>
Sun, 17 Oct 2021 12:51:19 +0000 (06:51 -0600)
commitabfe26a5c8a4ebcd0f033f0f452a1259605ac8ad
treee95a4fb202a0a1eec7c7bdfa96af425569b14ddc
parent3714a0e2ddfe1911eb786a38e59b34c073c5f570
brd: reduce the brd_devices_mutex scope

As with commit 8ab7aa5bbc016713 ("loop: reorder loop_exit"),
unregister_blkdev() needs to be called first in order to avoid calling
brd_alloc() from brd_probe() after brd_del_one() from brd_exit(). Then,
we can avoid holding global mutex during add_disk()/del_gendisk() as with
commit 97f10d20094b37dc ("loop: reduce the loop_ctl_mutex scope").

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/e205f13d-18ff-a49c-0988-7de6ea5ff823@i-love.sakura.ne.jp
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/brd.c