From: Hannes Reinecke <hare@suse.de>
To: wenxiong@linux.vnet.ibm.com, James.Bottomley@HansenPartnership.com
Cc: hch@infradead.org, linux-scsi@vger.kernel.org, brking@linux.vnet.ibm.com
Subject: Re: [V2 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath
Date: Tue, 04 Nov 2014 08:21:13 +0100 [thread overview]
Message-ID: <54587E69.50108@suse.de> (raw)
In-Reply-To: <20141103211815.000777763@linux.vnet.ibm.com>
On 11/03/2014 10:18 PM, wenxiong@linux.vnet.ibm.com wrote:
> This patch fixes an issue with multipath ipr SAS devices which require a
> start unit command to be issued following an adapter reset. Without this
> patch, paths get marked failed following an adapter reset and since the
> error handler never gets invoked to issue the start unit, the paths are
> never recovered. Returning FAILED for this case ensures the error
> handler wakes up to issue the start unit.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> Teste-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
> ---
> drivers/scsi/device_handler/scsi_dh_alua.c | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
>
> Index: b/drivers/scsi/device_handler/scsi_dh_alua.c
> ===================================================================
> --- a/drivers/scsi/device_handler/scsi_dh_alua.c 2014-10-29 20:50:29.000000000 -0500
> +++ b/drivers/scsi/device_handler/scsi_dh_alua.c 2014-11-03 14:24:39.482078993 -0600
> @@ -84,6 +84,7 @@ struct alua_dh_data {
>
> static char print_alua_state(int);
> static int alua_check_sense(struct scsi_device *, struct scsi_sense_hdr *);
> +static int alua_check_sense_handler(struct scsi_device *, struct scsi_sense_hdr *);
>
> static inline struct alua_dh_data *get_alua_data(struct scsi_device *sdev)
> {
> @@ -519,6 +520,23 @@ static int alua_check_sense(struct scsi_
> return SCSI_RETURN_NOT_HANDLED;
> }
>
> +static int alua_check_sense_handler(struct scsi_device *sdev,
> + struct scsi_sense_hdr *sense_hdr)
> +{
> + switch (sense_hdr->sense_key) {
> + case NOT_READY:
> + if (sdev->allow_restart &&
> + sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x02)
> + /*
> + * if the device is not started, we need to wake
> + * the error handler to start the motor
> + */
> + return FAILED;
> + break;
> + }
> + alua_check_sense(sdev, sense_hdr);
> +}
> +
> /*
> * alua_rtpg - Evaluate REPORT TARGET GROUP STATES
> * @sdev: the device to be evaluated.
> @@ -827,7 +845,7 @@ static struct scsi_device_handler alua_d
> .attach = alua_bus_attach,
> .detach = alua_bus_detach,
> .prep_fn = alua_prep_fn,
> - .check_sense = alua_check_sense,
> + .check_sense = alua_check_sense_handler,
> .activate = alua_activate,
> .set_params = alua_set_params,
> .match = alua_match,
>
Why did you use a wrapper for an already existing function?
Please fold the logic into alua_check_sense().
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-11-04 7:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 21:18 [V2 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong
2014-11-03 21:18 ` [V2 PATCH 1/2] scsi: call device handler for failed TUR command wenxiong
2014-11-03 21:18 ` [V2 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong
2014-11-04 7:21 ` Hannes Reinecke [this message]
2014-11-04 15:01 ` Christoph Hellwig
2014-11-05 8:56 ` Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2014-11-03 21:28 [ V2 PATCH 0/2] TUR path is down after adapter gets reset in multipath configuration wenxiong
2014-11-03 21:28 ` [ V2 PATCH 2/2] scsi: TUR path is down after adapter gets reset with multipath wenxiong
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=54587E69.50108@suse.de \
--to=hare@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.vnet.ibm.com \
--cc=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=wenxiong@linux.vnet.ibm.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 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.