diff --git a/block/blk-mq.c b/block/blk-mq.c index 690dbc02ab38e678bf98316c1c54978ebd2a2365..96debbe63ad205793bbf78bbe7129cc65e9b25a0 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1550,6 +1550,15 @@ void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs) if (blk_mq_hctx_stopped(hctx)) continue; + /* + * If there is already a run_work pending, leave the + * pending delay untouched. Otherwise, a hctx can stall + * if another hctx is re-delaying the other's work + * before the work executes. + */ + if (delayed_work_pending(&hctx->run_work)) + continue; + blk_mq_delay_run_hw_queue(hctx, msecs); } }