public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: "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: Thu, 29 Apr 2021 22:34:27 +0800	[thread overview]
Message-ID: <YIrD87Ekh3xBqE6u@T590> (raw)
In-Reply-To: <20210429122517.39659-4-hare@suse.de>

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.


Thanks,
Ming


  reply	other threads:[~2021-04-29 14:34 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 [this message]
2021-04-29 17:28     ` Hannes Reinecke
2021-05-04  7:49       ` Martin Wilck
2021-05-04  8:06         ` Ming Lei
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=YIrD87Ekh3xBqE6u@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 \
    /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