blk-flush: fix inverted scheduler check
diff mbox series

Message ID d52cf5d9-07a0-b643-e775-48139a4b19b0@kernel.dk
State New
Headers show
Series
  • blk-flush: fix inverted scheduler check
Related show

Commit Message

Jens Axboe Feb. 11, 2019, 11:11 p.m. UTC
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.

Reported-by: Dragan Milenkovic <dragan.milenkovic@pantelija.rs>
Fixes: 344e9ffcbd18 ("block: add queue_is_mq() helper")
Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

Comments

Jens Axboe Feb. 12, 2019, 2:49 a.m. UTC | #1
On 2/11/19 4:11 PM, Jens Axboe wrote:
> 
> 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.
> 
> Reported-by: Dragan Milenkovic <dragan.milenkovic@pantelija.rs>
> Fixes: 344e9ffcbd18 ("block: add queue_is_mq() helper")
> Signed-off-by: Jens Axboe <axboe@kernel.dk>

Disregard this one.
Ming Lei Feb. 15, 2019, 4:34 a.m. UTC | #2
On Mon, Feb 11, 2019 at 04:11:40PM -0700, Jens Axboe wrote:
> 
> 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.
> 
> Reported-by: Dragan Milenkovic <dragan.milenkovic@pantelija.rs>
> Fixes: 344e9ffcbd18 ("block: add queue_is_mq() helper")
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> ---
> 
> diff --git a/block/blk-flush.c b/block/blk-flush.c
> index 6e0f2d97fc6d..b56f4e5e6359 100644
> --- a/block/blk-flush.c
> +++ b/block/blk-flush.c
> @@ -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;

Reviewed-by: Ming Lei <ming.lei@redhat.com>

Thanks,
Ming

Patch
diff mbox series

diff --git a/block/blk-flush.c b/block/blk-flush.c
index 6e0f2d97fc6d..b56f4e5e6359 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -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;