blk-mq: return when hctx is stopped in blk_mq_run_work_fn
authorJianchao Wang <jianchao.w.wang@oracle.com>
Mon, 4 Jun 2018 09:03:55 +0000 (17:03 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Jun 2018 18:10:40 +0000 (12:10 -0600)
If a hardware queue is stopped, it should not be run again before
explicitly started. Ignore stopped queues in blk_mq_run_work_fn(),
fixing a regression recently introduced when the START_ON_RUN bit
was removed.

Fixes: 15fe8a90bb45 ("blk-mq: remove blk_mq_delay_queue()")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c

index 6332940ca1187f684343d9b7d6fcc21dd9e6e005..d2de0a719ab8018e2bf976ed4839ffc19dcff31e 100644 (file)
@@ -1475,7 +1475,7 @@ static void blk_mq_run_work_fn(struct work_struct *work)
         * If we are stopped, don't run the queue.
         */
        if (test_bit(BLK_MQ_S_STOPPED, &hctx->state))
-               clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
+               return;
 
        __blk_mq_run_hw_queue(hctx);
 }