public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/3] fnic: check for started requests in fnic_wq_copy_cleanup_handler()
Date: Tue, 4 May 2021 16:06:45 +0800	[thread overview]
Message-ID: <YJEAlV3IQ6HQL9jU@T590> (raw)
In-Reply-To: <1f62775363a5e9050b1a660ae5b114868dbbb9bc.camel@suse.com>

On Tue, May 04, 2021 at 09:49:12AM +0200, Martin Wilck wrote:
> On Thu, 2021-04-29 at 19:28 +0200, Hannes Reinecke wrote:
> > On 4/29/21 4:34 PM, Ming Lei wrote:
> > > On Thu, Apr 29, 2021 at 02:25:17PM +0200, Hannes Reinecke wrote:
> > > > fnic_wq_copy_cleanup_handler() is using scsi_host_find_tag() to
> > > > map id to a scsi command. However, as per discussion on the
> > > > mailinglist
> > > > scsi_host_find_tag() might return a non-started request, so we
> > > > need
> > > > to check the returned command with blk_mq_request_started() to
> > > > avoid
> > > > the function tripping over a non-initialized command.
> > > > 
> > > > Signed-off-by: Hannes Reinecke <hare@suse.de>
> > > > ---
> > > >   drivers/scsi/fnic/fnic_scsi.c | 2 +-
> > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/scsi/fnic/fnic_scsi.c
> > > > b/drivers/scsi/fnic/fnic_scsi.c
> > > > index 762cc8bd2653..b9fd3d87416b 100644
> > > > --- a/drivers/scsi/fnic/fnic_scsi.c
> > > > +++ b/drivers/scsi/fnic/fnic_scsi.c
> > > > @@ -1466,7 +1466,7 @@ void fnic_wq_copy_cleanup_handler(struct
> > > > vnic_wq_copy *wq,
> > > >                 return;
> > > >   
> > > >         sc = scsi_host_find_tag(fnic->lport->host, id);
> > > > -       if (!sc)
> > > > +       if (!sc || !blk_mq_request_started(sc->request))
> > > >                 return;
> > > 
> > > scsi_host_find_tag() has covered blk_mq_request_started check
> > > already, so
> > > this patch isn't necessary.
> > > 
> > Right. So drop it, then.
> 
> While you are at this, could you please re-consider e73a5e8e8003
> ("scsi: core: Only return started requests from scsi_host_find_tag()")
> in general?
> 
> I have come to think that commit is incorrect. It was created as an
> attempt to fix the observed fnic crashes, but it was ineffective. The
> crashes were eventually fixed by patch 2/3 of this series. 
> 
> IMO scsi_host_find_tag() should return a request if there is one,
> regardless whether or not it's started, and leave the decision to
> ignore pending requests to the caller, like it used to be until v5.8.

Can you share the cases in which SCSI needs to deal with non in-flight
requests via scsi_host_find_tag()? which is supposed to be used for retrieving
request via one active tag in scsi io completion path.


Thanks,
Ming


  reply	other threads:[~2021-05-04  8:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 12:25 [PATCH 0/3] fnic: use scsi_host_busy_iter() to traverse commands Hannes Reinecke
2021-04-29 12:25 ` [PATCH 1/3] fnic: kill 'exclude_id' argument to fnic_cleanup_io() Hannes Reinecke
2021-04-30  6:10   ` Ming Lei
2021-04-29 12:25 ` [PATCH 2/3] fnic: use scsi_host_busy_iter() to traverse commands Hannes Reinecke
2021-04-30  6:17   ` Ming Lei
2021-04-29 12:25 ` [PATCH 3/3] fnic: check for started requests in fnic_wq_copy_cleanup_handler() Hannes Reinecke
2021-04-29 14:34   ` Ming Lei
2021-04-29 17:28     ` Hannes Reinecke
2021-05-04  7:49       ` Martin Wilck
2021-05-04  8:06         ` Ming Lei [this message]
2021-05-04  8:57           ` Martin Wilck
2021-05-04 17:03             ` Bart Van Assche

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=YJEAlV3IQ6HQL9jU@T590 \
    --to=ming.lei@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.com \
    /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