]> www.infradead.org Git - nvme.git/commit
ublk: simplify aborting ublk request
authorMing Lei <ming.lei@redhat.com>
Wed, 16 Apr 2025 03:54:41 +0000 (11:54 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Apr 2025 01:33:21 +0000 (19:33 -0600)
commite63d2228ef831af36f963b3ab8604160cfff84c1
tree139a8680d920b49e37d6fcb56860e6c5c3f0259d
parent736b005b413a172670711ee17cab3c8ccab83223
ublk: simplify aborting ublk request

Now ublk_abort_queue() is moved to ublk char device release handler,
meantime our request queue is "quiesced" because either ->canceling was
set from uring_cmd cancel function or all IOs are inflight and can't be
completed by ublk server, things becomes easy much:

- all uring_cmd are done, so we needn't to mark io as UBLK_IO_FLAG_ABORTED
for handling completion from uring_cmd

- ublk char device is closed, no one can hold IO request reference any more,
so we can simply complete this request or requeue it for ublk_nosrv_should_reissue_outstanding.

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