Skip to content

Commit e8f0abd

Browse files
ChaitanayaKulkarniaxboe
authored andcommitted
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 <ckulkarnilinux@gmail.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b11e483 commit e8f0abd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/block/zloop.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,10 @@ static void zloop_handle_cmd(struct zloop_cmd *cmd)
548548
struct request *rq = blk_mq_rq_from_pdu(cmd);
549549
struct zloop_device *zlo = rq->q->queuedata;
550550

551+
/* We can block in this context, so ignore REQ_NOWAIT. */
552+
if (rq->cmd_flags & REQ_NOWAIT)
553+
rq->cmd_flags &= ~REQ_NOWAIT;
554+
551555
switch (req_op(rq)) {
552556
case REQ_OP_READ:
553557
case REQ_OP_WRITE:

0 commit comments

Comments
 (0)