diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/null_blk.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 6f0a58e7613d..6f9b7534928e 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -243,6 +243,17 @@ static enum hrtimer_restart null_cmd_timer_expired(struct hrtimer *timer) cmd = container_of(entry, struct nullb_cmd, ll_list); entry = entry->next; end_cmd(cmd); + + if (cmd->rq) { + struct request_queue *q = cmd->rq->q; + + if (!q->mq_ops && blk_queue_stopped(q)) { + spin_lock(q->queue_lock); + if (blk_queue_stopped(q)) + blk_start_queue(q); + spin_unlock(q->queue_lock); + } + } } while (entry); } @@ -334,6 +345,7 @@ static int null_rq_prep_fn(struct request_queue *q, struct request *req) req->special = cmd; return BLKPREP_OK; } + blk_stop_queue(q); return BLKPREP_DEFER; } |