Skip to content

Commit 5feeacd

Browse files
committed
blk-mq: add might_sleep check to blk_mq_get_driver_tag()
If the caller passes in wait=true, it has to be able to block for a driver tag. We just had a bug where flush insertion would block on tag allocation, while we had preempt disabled. Ensure that we catch cases like that earlier next time. Reviewed-by: Bart Van Assche <Bart.VanAssche@sandisk.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 0206319 commit 5feeacd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

block/blk-mq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,8 @@ bool blk_mq_get_driver_tag(struct request *rq, struct blk_mq_hw_ctx **hctx,
864864
.flags = wait ? 0 : BLK_MQ_REQ_NOWAIT,
865865
};
866866

867+
might_sleep_if(wait);
868+
867869
if (rq->tag != -1)
868870
goto done;
869871

0 commit comments

Comments
 (0)