linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Make blk_drain_queue() work for stopped queues
@ 2012-03-18 13:18 Bart Van Assche
  2012-03-18 15:57 ` Tejun Heo
  0 siblings, 1 reply; 15+ messages in thread
From: Bart Van Assche @ 2012-03-18 13:18 UTC (permalink / raw)
  To: Jens Axboe, Tejun Heo, Stanislaw Gruszka, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

All queued requests must be processed eventually. Hence make sure
that blk_drain_queue() drains the queue even if the queue is in the
stopped state. This patch makes it safe to invoke blk_cleanup_queue()
on a stopped queue.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Tejun Heo <tj@kernel.org>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: stable@vger.kernel.org
---
 block/blk-core.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 3a78b00..bdcec86 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -300,10 +300,8 @@ EXPORT_SYMBOL(blk_sync_queue);
  */
 void __blk_run_queue(struct request_queue *q)
 {
-	if (unlikely(blk_queue_stopped(q)))
-		return;
-
-	q->request_fn(q);
+	if (!blk_queue_stopped(q) || blk_queue_dead(q))
+		q->request_fn(q);
 }
 EXPORT_SYMBOL(__blk_run_queue);
 -- 1.7.7



[-- Attachment #2: Attached Message Part --]
[-- Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-03-24 18:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-18 13:18 [PATCH] block: Make blk_drain_queue() work for stopped queues Bart Van Assche
2012-03-18 15:57 ` Tejun Heo
2012-03-18 19:47   ` Bart Van Assche
2012-03-19  7:26     ` Stanislaw Gruszka
2012-03-19 17:03       ` Bart Van Assche
     [not found]         ` <4F6766F0.1070805-HInyCGIudOg@public.gmane.org>
2012-03-20 14:21           ` Stanislaw Gruszka
2012-03-20 14:31             ` Alan Stern
2012-03-19 17:04     ` Tejun Heo
2012-03-19 17:22       ` Bart Van Assche
2012-03-20 20:04       ` Bart Van Assche
2012-03-20 20:06       ` Bart Van Assche
2012-03-20 21:01         ` Dan Williams
2012-03-21  3:37           ` Dan Williams
2012-03-21 18:35             ` Dan Williams
2012-03-24 18:49             ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).