Skip to contentSkip to conversation

blk-flush: fix inverted scheduler check

PATCH In review Jens Axboe 2 participants 3 messages Feb 11, 2019 – Feb 15, 2019 Block layer

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 blk-flush: fix inverted scheduler check

A previous commit inadvertently inverted a check for whether or not we have an IO scheduler attached. This is reported to cause a hang with particular LVM setups.

Fixup the condition.

Fixes 344e9ffcbd18 ("block: add queue_is_mq() helper")

---

block/blk-flush.c +1 -1
index 6e0f2d97fc6d..b56f4e5e6359 100644
@@ -273,7 +273,7 @@ static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq,
 	 * assigned to empty flushes, and we deadlock if we are expecting
 	 * other requests to make progress. Don't defer for that case.
 	 */
-	if (!list_empty(&fq->flush_data_in_flight) && q->elevator &&
+	if (!list_empty(&fq->flush_data_in_flight) && !q->elevator &&
 	    time_before(jiffies,
 			fq->flush_pending_since + FLUSH_PENDING_TIMEOUT))
 		return;
Signature · 1 line
Jens Axboe
author maintainer
#1 lore raw
Quoted 10 lines · Jens Axboe

A previous commit inadvertently inverted a check for whether or not we have an IO scheduler attached. This is reported to cause a hang with particular LVM setups.

Fixup the condition.

Fixes 344e9ffcbd18 ("block: add queue_is_mq() helper")

Disregard this one.

Signature · 1 line
Jens Axboe
Reviewed-by on v1 1/1
#2 lore raw
In reply to Jens Axboe
Quoted 18 lines · Jens Axboe

A previous commit inadvertently inverted a check for whether or not we have an IO scheduler attached. This is reported to cause a hang with particular LVM setups.

Fixup the condition.

Fixes 344e9ffcbd18 ("block: add queue_is_mq() helper")

---

block/blk-flush.c +0 -0
index 6e0f2d97fc6d..b56f4e5e6359 100644

block/blk-flush.c static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq, · line 279

Quoted 8 lines
block/blk-flush.c +1 -1
@@ -273,7 +273,7 @@ static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq,
 	 * assigned to empty flushes, and we deadlock if we are expecting
 	 * other requests to make progress. Don't defer for that case.
 	 */
-	if (!list_empty(&fq->flush_data_in_flight) && q->elevator &&
+	if (!list_empty(&fq->flush_data_in_flight) && !q->elevator &&
 	    time_before(jiffies,
 			fq->flush_pending_since + FLUSH_PENDING_TIMEOUT))
 		return;

Thanks,
Ming