All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: null_blk: end timed out poll request
@ 2022-04-13  8:48 Ming Lei
  2022-04-14 16:16 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2022-04-13  8:48 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, 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.

Fixes: 0a593fbbc245 ("null_blk: poll queue support")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 drivers/block/null_blk/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 05b1120e6623..c441a4972064 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -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;
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: null_blk: end timed out poll request
  2022-04-13  8:48 [PATCH] block: null_blk: end timed out poll request Ming Lei
@ 2022-04-14 16:16 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-04-14 16:16 UTC (permalink / raw)
  To: ming.lei; +Cc: linux-block

On Wed, 13 Apr 2022 16:48:36 +0800, Ming Lei wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-14 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13  8:48 [PATCH] block: null_blk: end timed out poll request Ming Lei
2022-04-14 16:16 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.