All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org
Cc: dillowda-1Heg1YXhbW8@public.gmane.org,
	roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/5] ib_srp: check if rport->lld_data is NULL before removing rport
Date: Sat, 01 Sep 2012 07:59:24 +0000	[thread overview]
Message-ID: <5041C05C.5060608@acm.org> (raw)
In-Reply-To: <1346443241-24844-5-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>

On 08/31/12 20:00, dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org wrote:
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index 1b274484..ba7bbfd 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -647,9 +647,19 @@ static void srp_remove_work(struct work_struct *work)
>  
>  static void srp_rport_delete(struct srp_rport *rport)
>  {
> -	struct srp_target_port *target = rport->lld_data;
> +	struct srp_target_port *target;
> +
> +	if (!rport->lld_data) {
> +		pr_warn("skipping srp_rport_delete. rport->lld_data=%p\n",
> +			rport->lld_data);
> +		return;
> +	}
> +
> +	target = rport->lld_data;
>  
>  	srp_queue_remove_work(target);
> +
> +	rport->lld_data = NULL;
>  }
>  
>  /**
> diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
> index af3cb56..915b355 100644
> --- a/drivers/scsi/scsi_transport_srp.c
> +++ b/drivers/scsi/scsi_transport_srp.c
> @@ -272,6 +272,12 @@ static void rport_dev_loss_timedout(struct work_struct *work)
>  	struct Scsi_Host *shost;
>  	struct srp_internal *i;
>  
> +	if (!rport->lld_data) {
> +		pr_warn("skipping rport_delete, rport->lld_data=%p\n",
> +			rport->lld_data);
> +		return;
> +	}
> +
>  	pr_err("SRP transport: dev_loss_tmo (%ds) expired - removing %s.\n",
>  	       rport->dev_loss_tmo, dev_name(&rport->dev));
>  

The above changes look harmless to me. But what I'd really like to know
is whether the pr_warn() statements added by this patch have been hit
after testing with patch [5/5] started ? The srp-ha patch series has
been designed such that rport->lld_data != NULL as long as the rport
data structure exists.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-09-01  7:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 20:00 [PATCH 0/5] Fix bugs in ib_srp patches for H.A. purposes dongsu.park-EIkl63zCoXaH+58JC4qpiA
2012-08-31 20:00 ` dongsu.park
2012-08-31 20:00 ` [PATCH 1/5] ib_srp: free memory correctly in srp_free_iu() dongsu.park
     [not found]   ` <1346443241-24844-2-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:32     ` Bart Van Assche
2012-08-31 20:00 ` [PATCH 2/5] ib_srp: removed superfluous warning in send timeout case dongsu.park
     [not found]   ` <1346443241-24844-3-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:44     ` Bart Van Assche
2012-08-31 20:00 ` [PATCH 3/5] ib_srp: hold a mutex when adding a new target port dongsu.park
     [not found]   ` <1346443241-24844-4-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:55     ` Bart Van Assche
2012-08-31 20:00 ` [PATCH 4/5] ib_srp: check if rport->lld_data is NULL before removing rport dongsu.park
     [not found]   ` <1346443241-24844-5-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:59     ` Bart Van Assche [this message]
     [not found] ` <1346443241-24844-1-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-08-31 20:00   ` [PATCH 5/5] ib_srp: fix an error accessing invalid memory in rport_dev_loss_timedout dongsu.park-EIkl63zCoXaH+58JC4qpiA
2012-08-31 20:00     ` dongsu.park
2012-09-01  8:09   ` [PATCH 0/5] Fix bugs in ib_srp patches for H.A. purposes Bart Van Assche
2012-09-01  8:09     ` 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=5041C05C.5060608@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    --cc=dillowda-1Heg1YXhbW8@public.gmane.org \
    --cc=dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 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.