]> www.infradead.org Git - nvme.git/commit
ublk: move device reset into ublk_ch_release()
authorMing Lei <ming.lei@redhat.com>
Wed, 16 Apr 2025 03:54:38 +0000 (11:54 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Apr 2025 01:33:21 +0000 (19:33 -0600)
commit728cbac5fe219d3b8a21a0688a08f2b7f8aeda2b
tree91a52752989fe540aa9a585069961af581b6b69d
parent7e26cb69c5e62152a6f05a2ae23605a983a8ef31
ublk: move device reset into ublk_ch_release()

ublk_ch_release() is called after ublk char device is closed, when all
uring_cmd are done, so it is perfect fine to move ublk device reset to
ublk_ch_release() from ublk_ctrl_start_recovery().

This way can avoid to grab the exiting daemon task_struct too long.

However, reset of the following ublk IO flags has to be moved until ublk
io_uring queues are ready:

- ubq->canceling

For requeuing IO in case of ublk_nosrv_dev_should_queue_io() before device
is recovered

- ubq->fail_io

For failing IO in case of UBLK_F_USER_RECOVERY_FAIL_IO before device is
recovered

- ublk_io->flags

For preventing using io->cmd

With this way, recovery is simplified a lot.

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