]> Pileus Git - ~andy/linux/blobdiff - block/blk-exec.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[~andy/linux] / block / blk-exec.c
index 81e31819a597bb0c6ed6dd4f781eb037c986a243..a1ebceb332f963ee366aa7ebed60d69c4e1c11cb 100644 (file)
@@ -50,13 +50,20 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
 {
        int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
 
+       if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) {
+               rq->errors = -ENXIO;
+               if (rq->end_io)
+                       rq->end_io(rq, rq->errors);
+               return;
+       }
+
        rq->rq_disk = bd_disk;
        rq->end_io = done;
        WARN_ON(irqs_disabled());
        spin_lock_irq(q->queue_lock);
        __elv_add_request(q, rq, where);
        __blk_run_queue(q);
-       /* the queue is stopped so it won't be plugged+unplugged */
+       /* the queue is stopped so it won't be run */
        if (rq->cmd_type == REQ_TYPE_PM_RESUME)
                q->request_fn(q);
        spin_unlock_irq(q->queue_lock);