Skip to contentSkip to conversation

blk-mq: fail the request in case issue failure

PATCH Applied Ming Lei 2 participants 2 messages Jul 22, 2018 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: fail the request in case issue failure

Inside blk_mq_try_issue_list_directly(), if the request is issued as failed, we shouldn't try to do it again, otherwise the warning in blk_mq_start_request() will be triggered. This change is aligned to behaviour of other ways of request issue & dispatch.

Fixes 6ce3dd6eec1 ("blk-mq: issue directly if hw queue isn't busy in case of 'none'")
Cc Kashyap Desai <[email protected]>
Cc Laurence Oberman <[email protected]>
Cc Omar Sandoval <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Bart Van Assche <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Kashyap Desai <[email protected]>
Cc kernel test robot <[email protected]>
---
 block/blk-mq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
block/blk-mq.c +6 -2
index 21f3eda98431..e13bdc2707ce 100644
@@ -1794,8 +1794,12 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
 		list_del_init(&rq->queuelist);
 		ret = blk_mq_request_issue_directly(rq);
 		if (ret != BLK_STS_OK) {
-			list_add(&rq->queuelist, list);
-			break;
+			if (ret == BLK_STS_RESOURCE ||
+					ret == BLK_STS_DEV_RESOURCE) {
+				list_add(&rq->queuelist, list);
+				break;
+			}
+			blk_mq_end_request(rq, ret);
 		}
 	}
 }
Signature · 1 line
2.9.5
maintainer Applied
#1 lore raw
Quoted 4 lines · Ming Lei

Inside blk_mq_try_issue_list_directly(), if the request is issued as failed, we shouldn't try to do it again, otherwise the warning in blk_mq_start_request() will be triggered. This change is aligned to behaviour of other ways of request issue & dispatch.

Applied, thanks.

Signature · 1 line
Jens Axboe