Block: Fix blk_start_queueing() so as not to process a stopped queue

Previous thread: [PATCH] x86: clean up speedctep-centrino and reduce cpumask_t usage by Rusty Russell on Tuesday, September 30, 2008 - 4:01 pm. (3 messages)

Next thread: [PATCH 1/3] x86: mtrr_cleanup update command line by Yinghai Lu on Tuesday, September 30, 2008 - 4:29 pm. (18 messages)
From: Elias Oltmanns
Date: Tuesday, September 30, 2008 - 4:19 pm

Especially since blk_start_queueing() is used as the unplug_fn() callback
by the cfq scheduler, we'd better make it behave like a proper unplug
function. That is to say, return immediately if the queue is stopped.

Cc: stable <stable@kernel.org>
Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
---
This is not a recent regression, so it might not be accepted as an rc
fix. However, it most definitely is a bug and should go into a stable
release. Applies to 2.6.27-rc8.

 block/blk-core.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 2cba5ef..f9a0bfb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -888,9 +888,11 @@ EXPORT_SYMBOL(blk_get_request);
  */
 void blk_start_queueing(struct request_queue *q)
 {
-	if (!blk_queue_plugged(q))
+	if (!blk_queue_plugged(q)) {
+		if (unlikely(blk_queue_stopped(q)))
+			return;
 		q->request_fn(q);
-	else
+	} else
 		__generic_unplug_device(q);
 }
 EXPORT_SYMBOL(blk_start_queueing);
--

From: Jens Axboe
Date: Wednesday, October 1, 2008 - 12:48 am

I don't think this is by far serious enough for -stable. Please let me
know what bad behaviour you observed due to this bug?

-- 
Jens Axboe

--

Previous thread: [PATCH] x86: clean up speedctep-centrino and reduce cpumask_t usage by Rusty Russell on Tuesday, September 30, 2008 - 4:01 pm. (3 messages)

Next thread: [PATCH 1/3] x86: mtrr_cleanup update command line by Yinghai Lu on Tuesday, September 30, 2008 - 4:29 pm. (18 messages)