public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>, "hch@lst.de" <hch@lst.de>,
	"tj@kernel.org" <tj@kernel.org>,
	"israelr@mellanox.com" <israelr@mellanox.com>,
	"maxg@mellanox.com" <maxg@mellanox.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH] blk-mq: fix race between complete and BLK_EH_RESET_TIMER
Date: Thu, 12 Apr 2018 07:06:48 +0800	[thread overview]
Message-ID: <20180411230647.GC31433@ming.t460p> (raw)
In-Reply-To: <2ed5dc7a4d1553c7ba3f9bbe43aac313eba29dc8.camel@wdc.com>

On Wed, Apr 11, 2018 at 10:49:51PM +0000, Bart Van Assche wrote:
> On Thu, 2018-04-12 at 04:55 +0800, Ming Lei wrote:
> > +again:
> >  	switch (ret) {
> >  	case BLK_EH_HANDLED:
> >  		__blk_mq_complete_request(req);
> >  		break;
> >  	case BLK_EH_RESET_TIMER:
> >  		[ ... ]
> > +		spin_lock_irqsave(req->q->queue_lock, flags);
> > +		if (blk_mq_rq_state(req) != MQ_RQ_COMPLETE_IN_RESET) {
> > +			blk_mq_rq_update_aborted_gstate(req, 0);
> > +			blk_add_timer(req);
> > +		} else {
> > +			blk_mq_rq_update_state(req, MQ_RQ_IN_FLIGHT);
> > +			ret = BLK_EH_HANDLED;
> > +			goto again;
> > +		}
> > +		spin_unlock_irqrestore(req->q->queue_lock, flags);
> 
> Does the above chunk introduce a backwards goto from inside a region around
> which a spinlock is held to outside that region? Can such a goto result in
> anything else than a deadlock?

Yes, it is being fixed in my local V2, :-)

-- 
Ming

      reply	other threads:[~2018-04-11 23:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 20:55 [PATCH] blk-mq: fix race between complete and BLK_EH_RESET_TIMER Ming Lei
2018-04-11 21:30 ` Tejun Heo
2018-04-11 22:43   ` Ming Lei
2018-04-11 22:47     ` Tejun Heo
2018-04-11 23:05       ` Ming Lei
2018-04-12 13:57         ` Tejun Heo
2018-04-13 15:38           ` Ming Lei
2018-04-11 22:49 ` Bart Van Assche
2018-04-11 23:06   ` Ming Lei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180411230647.GC31433@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=israelr@mellanox.com \
    --cc=linux-block@vger.kernel.org \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox