Skip to contentSkip to conversation

block: null_blk: end timed out poll request

PATCH Applied Ming Lei 2 participants 2 messages Apr 13, 2022 – Apr 14, 2022 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 block: null_blk: end timed out poll request

When poll request is timed out, it is removed from the poll list, but not completed, so the request is leaked, and never get chance to complete.

Fix the issue by ending it in timeout handler.

Fixes 0a593fbbc245 ("null_blk: poll queue support")
---
 drivers/block/null_blk/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/null_blk/main.c +1 -1
index 05b1120e6623..c441a4972064 100644
@@ -1600,7 +1600,7 @@ static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res)
 	 * Only fake timeouts need to execute blk_mq_complete_request() here.
 	 */
 	cmd->error = BLK_STS_TIMEOUT;
-	if (cmd->fake_timeout)
+	if (cmd->fake_timeout || hctx->type == HCTX_TYPE_POLL)
 		blk_mq_complete_request(rq);
 	return BLK_EH_DONE;
 }
Signature · 1 line
2.31.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Ming Lei

When poll request is timed out, it is removed from the poll list, but not completed, so the request is leaked, and never get chance to complete.

Fix the issue by ending it in timeout handler.

[...]

Applied, thanks!

[1/1] block: null_blk: end timed out poll request

      commit: 3e3876d322aef82416ecc496a4d4a587e0fdf7a3

Best regards,

Signature · 1 line
Jens Axboe