diff options
author | 2025-03-27 17:51:11 +0800 | |
---|---|---|
committer | 2025-03-28 16:15:42 -0600 | |
commit | 7e2fe01a69f6be3e284b38cfd2e4e0598a3b0a8f (patch) | |
tree | 40e6f815d73fb1dff02214c81da7e8dcba905bfd | |
parent | ublk: make sure ubq->canceling is set when queue is frozen (diff) | |
download | wireguard-linux-7e2fe01a69f6be3e284b38cfd2e4e0598a3b0a8f.tar.xz wireguard-linux-7e2fe01a69f6be3e284b38cfd2e4e0598a3b0a8f.zip |
ublk: comment on ubq->canceling handling in ublk_queue_rq()
In ublk_queue_rq(), ubq->canceling has to be handled after ->fail_io and
->force_abort are dealt with, otherwise the request may not be failed
when deleting disk.
Add comment on this usage.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250327095123.179113-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | drivers/block/ublk_drv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index fbcb7c2ff851..5b0c885dc38f 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1310,6 +1310,11 @@ static blk_status_t ublk_queue_rq(struct blk_mq_hw_ctx *hctx, if (ublk_nosrv_should_queue_io(ubq) && unlikely(ubq->force_abort)) return BLK_STS_IOERR; + /* + * ->canceling has to be handled after ->force_abort and ->fail_io + * is dealt with, otherwise this request may not be failed in case + * of recovery, and cause hang when deleting disk + */ if (unlikely(ubq->canceling)) { __ublk_abort_rq(ubq, rq); return BLK_STS_OK; |