]> www.infradead.org Git - nvme.git/commit
ublk: rely on ->canceling for dealing with ublk_nosrv_dev_should_queue_io
authorMing Lei <ming.lei@redhat.com>
Wed, 16 Apr 2025 03:54:37 +0000 (11:54 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Apr 2025 01:33:21 +0000 (19:33 -0600)
commit7e26cb69c5e62152a6f05a2ae23605a983a8ef31
treeac2815ef7eb26e270c3c1c23d6e7b653280480d0
parent00b3b0d7cb454d614117c93f33351cdcd20b5b93
ublk: rely on ->canceling for dealing with ublk_nosrv_dev_should_queue_io

Now ublk deals with ublk_nosrv_dev_should_queue_io() by keeping request
queue as quiesced. This way is fragile because queue quiesce crosses syscalls
or process contexts.

Switch to rely on ubq->canceling for dealing with
ublk_nosrv_dev_should_queue_io(), because it has been used for this purpose
during io_uring context exiting, and it can be reused before recovering too.
In ublk_queue_rq(), the request will be added to requeue list without
kicking off requeue in case of ubq->canceling, and finally requests added in
requeue list will be dispatched from either ublk_stop_dev() or
ublk_ctrl_end_recovery().

Meantime we have to move reset of ubq->canceling from ublk_ctrl_start_recovery()
to ublk_ctrl_end_recovery(), when IO handling can be recovered completely.

Then blk_mq_quiesce_queue() and blk_mq_unquiesce_queue() are always used
in same context.

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