Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220413084836.1571995-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
3e3876d3 8535c018

+1 -1
+1 -1
drivers/block/null_blk/main.c
··· 1600 1600 * Only fake timeouts need to execute blk_mq_complete_request() here. 1601 1601 */ 1602 1602 cmd->error = BLK_STS_TIMEOUT; 1603 - if (cmd->fake_timeout) 1603 + if (cmd->fake_timeout || hctx->type == HCTX_TYPE_POLL) 1604 1604 blk_mq_complete_request(rq); 1605 1605 return BLK_EH_DONE; 1606 1606 }