Skip to content

Commit 7e2fe01

Browse files
Ming Leiaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8741d07 commit 7e2fe01

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/block/ublk_drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,11 @@ static blk_status_t ublk_queue_rq(struct blk_mq_hw_ctx *hctx,
13101310
if (ublk_nosrv_should_queue_io(ubq) && unlikely(ubq->force_abort))
13111311
return BLK_STS_IOERR;
13121312

1313+
/*
1314+
* ->canceling has to be handled after ->force_abort and ->fail_io
1315+
* is dealt with, otherwise this request may not be failed in case
1316+
* of recovery, and cause hang when deleting disk
1317+
*/
13131318
if (unlikely(ubq->canceling)) {
13141319
__ublk_abort_rq(ubq, rq);
13151320
return BLK_STS_OK;

0 commit comments

Comments
 (0)