linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@suse.de>
To: Mike Snitzer <snitzer@redhat.com>
Cc: linux-scsi@vger.kernel.org, Eddie Williams <eddie.williams@steeleye.com>
Subject: Re: [PATCH for-2.6.39] [SCSI] scsi_dh_emc: fix panic when handling multiple path failures
Date: Mon, 21 Mar 2011 15:02:54 -0500	[thread overview]
Message-ID: <1300737774.10634.37.camel@mulgrave.site> (raw)
In-Reply-To: <1300737433-11994-1-git-send-email-snitzer@redhat.com>

On Mon, 2011-03-21 at 15:57 -0400, Mike Snitzer wrote:
> From: Eddie Williams <eddie.williams@steeleye.com>
> 
> Do not sdev_printk() a scsi_device that was, or is being, deleted.
> 
> If multiple failures occur (e.g. FC switch with multiple paths fails),
> and both the active path and next path is failed in the process, the
> scsi_device associated with the next path can be accessed after it was
> deleted.

This treats the symptom, not the cause, doesn't it?  Why do we have a
reference to an ungot instance of an sdev here ... and should it have
had a reference taken on it?

James


> Signed-off-by: Eddie Williams <eddie.williams@steeleye.com>
> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
> ---
>  drivers/scsi/device_handler/scsi_dh_emc.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
> index 48441f6..670f059 100644
> --- a/drivers/scsi/device_handler/scsi_dh_emc.c
> +++ b/drivers/scsi/device_handler/scsi_dh_emc.c
> @@ -537,14 +537,14 @@ static int clariion_activate(struct scsi_device *sdev,
>  
>  	result = clariion_send_inquiry(sdev, csdev);
>  	if (result != SCSI_DH_OK)
> -		goto done;
> +		goto out;
>  
>  	if (csdev->lun_state == CLARIION_LUN_OWNED)
>  		goto done;
>  
>  	result = send_trespass_cmd(sdev, csdev);
>  	if (result != SCSI_DH_OK)
> -		goto done;
> +		goto out;
>  	sdev_printk(KERN_INFO, sdev,"%s: %s trespass command sent\n",
>  		    CLARIION_NAME,
>  		    csdev->flags&CLARIION_SHORT_TRESPASS?"short":"long" );
> @@ -552,7 +552,7 @@ static int clariion_activate(struct scsi_device *sdev,
>  	/* Update status */
>  	result = clariion_send_inquiry(sdev, csdev);
>  	if (result != SCSI_DH_OK)
> -		goto done;
> +		goto out;
>  
>  done:
>  	sdev_printk(KERN_INFO, sdev,
> @@ -561,10 +561,12 @@ done:
>  		    csdev->port, lun_state[csdev->lun_state],
>  		    csdev->default_sp + 'A');
>  
> +out:
>  	if (fn)
>  		fn(data, result);
>  	return 0;
>  }
> +
>  /*
>   * params - parameters in the following format
>   *      "no_of_params\0param1\0param2\0param3\0...\0"



  reply	other threads:[~2011-03-21 20:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 19:57 [PATCH for-2.6.39] [SCSI] scsi_dh_emc: fix panic when handling multiple path failures Mike Snitzer
2011-03-21 20:02 ` James Bottomley [this message]
2011-03-21 20:38   ` Mike Snitzer
2011-03-21 20:44     ` James Bottomley
2011-03-21 23:16       ` Mike Snitzer
     [not found]         ` <AANLkTimknz6=6CeURQD_ZB+9DD9W20-rfktjp75nsZrW@mail.gmail.com>
2011-03-22  2:36           ` Eddie Williams
2011-03-23 21:58         ` Mike Snitzer
2011-03-23 22:03           ` James Bottomley
2011-03-23 23:02             ` Mike Snitzer

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=1300737774.10634.37.camel@mulgrave.site \
    --to=james.bottomley@suse.de \
    --cc=eddie.williams@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=snitzer@redhat.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;
as well as URLs for NNTP newsgroup(s).