]> git.baikalelectronics.ru Git - kernel.git/commit
brd: remove brd_devices_mutex mutex
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Thu, 6 Jan 2022 09:53:16 +0000 (18:53 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 17 Jan 2022 14:19:40 +0000 (07:19 -0700)
commiteaf59e66bcbff8148a9d9aac3b7d0528276ce51c
treed2eb3e96ccf410dd73ddb8c23329960367d683e6
parent9780446f691614ba0c6cf6feda1964c687c59ead
brd: remove brd_devices_mutex mutex

If brd_alloc() from brd_probe() is called before brd_alloc() from
brd_init() is called, module loading will fail with -EEXIST error.
To close this race, call __register_blkdev() just before leaving
brd_init().

Then, we can remove brd_devices_mutex mutex, for brd_device list
will no longer be accessed concurrently.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/6b074af7-c165-4fab-b7da-8270a4f6f6cd@i-love.sakura.ne.jp
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/brd.c