If an io_batch is passed in to blk_poll(), we need to assign the batch handler associated with this queue. This allows callers to complete an io_batch handler on by calling it. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> --- block/blk-mq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index d603703cf272..deafd444761d 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4302,6 +4302,19 @@ static int blk_mq_poll_classic(struct request_queue *q, blk_qc_t cookie, hctx->poll_considered++; + /* + * If batching is requested but the target doesn't support batched + * completions, then just clear ib and completions will be handled + * normally. + */ + if (iob) { + iob->complete = q->mq_ops->complete_batch; + if (!iob->complete) { + WARN_ON_ONCE(iob->req_list); + iob = NULL; + } + } + do { hctx->poll_invoked++; -- 2.33.0