From: Chaitanya Kulkarni Date: Wed, 19 Nov 2025 23:22:34 +0000 (-0800) Subject: zloop: clear nowait flag in workqueue context X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8f0abdd49baacee3886d5827f113514fcd9fd05;p=thirdparty%2Flinux.git zloop: clear nowait flag in workqueue context The zloop driver advertises REQ_NOWAIT support through BLK_FEAT_NOWAIT (enabled by default for all blk-mq devices), and honors the nowait behavior throughout zloop_queue_rq(). However, actual I/O to the backing file is performed in a workqueue, where blocking is allowed. To avoid imposing unnecessary non-blocking constraints in this blocking context, clear the REQ_NOWAIT flag before processing the request in the workqueue context. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal Signed-off-by: Jens Axboe --- diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c index 1273bbca78432..3f50321aa4a75 100644 --- a/drivers/block/zloop.c +++ b/drivers/block/zloop.c @@ -548,6 +548,10 @@ static void zloop_handle_cmd(struct zloop_cmd *cmd) struct request *rq = blk_mq_rq_from_pdu(cmd); struct zloop_device *zlo = rq->q->queuedata; + /* We can block in this context, so ignore REQ_NOWAIT. */ + if (rq->cmd_flags & REQ_NOWAIT) + rq->cmd_flags &= ~REQ_NOWAIT; + switch (req_op(rq)) { case REQ_OP_READ: case REQ_OP_WRITE: