ublk: improve getting & putting ublk device
authorMing Lei <ming.lei@redhat.com>
Fri, 23 Feb 2024 07:55:38 +0000 (15:55 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Feb 2024 01:47:08 +0000 (18:47 -0700)
commit1221b9e982e181f1c37789c46fe5bfe32d97bec4
tree2e8220ef7cbc9cf5c077f41f4ecdcd5d5bdb45a0
parentec30b461f3d067bd322a6c3a6c5105746ed9bf14
ublk: improve getting & putting ublk device

Firstly convert get_device() and put_device() into ublk_get_device()
and ublk_put_device().

Secondly annotate ublk_get_device() & ublk_put_device() as noinline
for trace, especially it is often to trigger device deletion hang
when incorrect order is used on ublkc mmap, ublkc close,
io_uring_sqe_unregister_file, ublkb close.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20240223075539.89945-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c