diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index c37e9e7c9d07..30add45a87ef 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1731,6 +1731,10 @@ int blk_insert_cloned_request(struct request_queue *q, struct request *rq) | |||
1731 | return -EIO; | 1731 | return -EIO; |
1732 | 1732 | ||
1733 | spin_lock_irqsave(q->queue_lock, flags); | 1733 | spin_lock_irqsave(q->queue_lock, flags); |
1734 | if (unlikely(blk_queue_dead(q))) { | ||
1735 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
1736 | return -ENODEV; | ||
1737 | } | ||
1734 | 1738 | ||
1735 | /* | 1739 | /* |
1736 | * Submitting request must be dequeued before calling this function | 1740 | * Submitting request must be dequeued before calling this function |
@@ -2705,6 +2709,14 @@ static void queue_unplugged(struct request_queue *q, unsigned int depth, | |||
2705 | trace_block_unplug(q, depth, !from_schedule); | 2709 | trace_block_unplug(q, depth, !from_schedule); |
2706 | 2710 | ||
2707 | /* | 2711 | /* |
2712 | * Don't mess with dead queue. | ||
2713 | */ | ||
2714 | if (unlikely(blk_queue_dead(q))) { | ||
2715 | spin_unlock(q->queue_lock); | ||
2716 | return; | ||
2717 | } | ||
2718 | |||
2719 | /* | ||
2708 | * If we are punting this to kblockd, then we can safely drop | 2720 | * If we are punting this to kblockd, then we can safely drop |
2709 | * the queue_lock before waking kblockd (which needs to take | 2721 | * the queue_lock before waking kblockd (which needs to take |
2710 | * this lock). | 2722 | * this lock). |
@@ -2780,6 +2792,15 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) | |||
2780 | depth = 0; | 2792 | depth = 0; |
2781 | spin_lock(q->queue_lock); | 2793 | spin_lock(q->queue_lock); |
2782 | } | 2794 | } |
2795 | |||
2796 | /* | ||
2797 | * Short-circuit if @q is dead | ||
2798 | */ | ||
2799 | if (unlikely(blk_queue_dead(q))) { | ||
2800 | __blk_end_request_all(rq, -ENODEV); | ||
2801 | continue; | ||
2802 | } | ||
2803 | |||
2783 | /* | 2804 | /* |
2784 | * rq is already accounted, so use raw insert | 2805 | * rq is already accounted, so use raw insert |
2785 | */ | 2806 | */ |