All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block-mq: don't re-queue if we get a queue error
@ 2017-03-28 20:37 Josef Bacik
  2017-03-29  2:04 ` Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Josef Bacik @ 2017-03-28 20:37 UTC (permalink / raw)
  To: linux-block, kernel-team

When try to issue a request directly and we fail we will requeue the
request, but call blk_mq_end_request() as well.  This leads to the
completed request being on a queuelist and getting ended twice, which
causes list corruption in schedulers and other shenanigans.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 block/blk-mq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 08a49c6..c5a6985 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1457,8 +1457,6 @@ static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
 		return;
 	}
 
-	__blk_mq_requeue_request(rq);
-
 	if (ret == BLK_MQ_RQ_QUEUE_ERROR) {
 		*cookie = BLK_QC_T_NONE;
 		rq->errors = -EIO;
@@ -1466,6 +1464,7 @@ static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
 		return;
 	}
 
+	__blk_mq_requeue_request(rq);
 insert:
 	blk_mq_sched_insert_request(rq, false, true, false, may_sleep);
 }
-- 
2.7.4

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

* Re: [PATCH] block-mq: don't re-queue if we get a queue error
  2017-03-28 20:37 [PATCH] block-mq: don't re-queue if we get a queue error Josef Bacik
@ 2017-03-29  2:04 ` Ming Lei
  2017-03-29 18:01 ` Sagi Grimberg
  2017-03-29 19:19 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2017-03-29  2:04 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-block, kernel-team

On Tue, Mar 28, 2017 at 04:37:52PM -0400, Josef Bacik wrote:
> When try to issue a request directly and we fail we will requeue the
> request, but call blk_mq_end_request() as well.  This leads to the
> completed request being on a queuelist and getting ended twice, which
> causes list corruption in schedulers and other shenanigans.
> 
> Signed-off-by: Josef Bacik <jbacik@fb.com>
> ---
>  block/blk-mq.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 08a49c6..c5a6985 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1457,8 +1457,6 @@ static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
>  		return;
>  	}
>  
> -	__blk_mq_requeue_request(rq);
> -
>  	if (ret == BLK_MQ_RQ_QUEUE_ERROR) {
>  		*cookie = BLK_QC_T_NONE;
>  		rq->errors = -EIO;
> @@ -1466,6 +1464,7 @@ static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
>  		return;
>  	}
>  
> +	__blk_mq_requeue_request(rq);
>  insert:
>  	blk_mq_sched_insert_request(rq, false, true, false, may_sleep);
>  }

Reviewed-by: Ming Lei <tom.leiming@gmail.com>

-- 
Ming

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

* Re: [PATCH] block-mq: don't re-queue if we get a queue error
  2017-03-28 20:37 [PATCH] block-mq: don't re-queue if we get a queue error Josef Bacik
  2017-03-29  2:04 ` Ming Lei
@ 2017-03-29 18:01 ` Sagi Grimberg
  2017-03-29 19:19 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2017-03-29 18:01 UTC (permalink / raw)
  To: Josef Bacik, linux-block, kernel-team

Looks good,

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

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

* Re: [PATCH] block-mq: don't re-queue if we get a queue error
  2017-03-28 20:37 [PATCH] block-mq: don't re-queue if we get a queue error Josef Bacik
  2017-03-29  2:04 ` Ming Lei
  2017-03-29 18:01 ` Sagi Grimberg
@ 2017-03-29 19:19 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2017-03-29 19:19 UTC (permalink / raw)
  To: Josef Bacik, linux-block, kernel-team

On 03/28/2017 02:37 PM, Josef Bacik wrote:
> When try to issue a request directly and we fail we will requeue the
> request, but call blk_mq_end_request() as well.  This leads to the
> completed request being on a queuelist and getting ended twice, which
> causes list corruption in schedulers and other shenanigans.

I think this is purely a cosmetic issue, as it should cause no
corruption. But it doesn't make sense to issue a requeue trace,
for instance, if we're just going to end the IO anyway. I have
applied it for 4.12.

-- 
Jens Axboe

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

end of thread, other threads:[~2017-03-29 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28 20:37 [PATCH] block-mq: don't re-queue if we get a queue error Josef Bacik
2017-03-29  2:04 ` Ming Lei
2017-03-29 18:01 ` Sagi Grimberg
2017-03-29 19:19 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.