From: Martin Wilck <mwilck@suse.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>
Cc: Bart Van Assche <Bart.VanAssche@sandisk.com>,
Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>,
linux-scsi@vger.kernel.org
Subject: [PATCH 2/3] scsi_dh_alua: Do not retry for unmapped device
Date: Fri, 28 Apr 2017 15:06:25 +0200 [thread overview]
Message-ID: <20170428130626.32162-3-mwilck@suse.com> (raw)
In-Reply-To: <20170428130626.32162-1-mwilck@suse.com>
From: Hannes Reinecke <hare@suse.de>
If a device becomes unmapped on the target we should be returning
SCSI_DH_DEV_OFFLINED.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
---
drivers/scsi/device_handler/scsi_dh_alua.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index b90a5dec199f..501855bde633 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -522,7 +522,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
struct alua_port_group *tmp_pg;
int len, k, off, valid_states = 0, bufflen = ALUA_RTPG_SIZE;
unsigned char *desc, *buff;
- unsigned err, retval;
+ unsigned err = SCSI_DH_OK, retval;
unsigned int tpg_desc_tbl_off;
unsigned char orig_transition_tmo;
unsigned long flags;
@@ -541,7 +541,6 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
return SCSI_DH_DEV_TEMP_BUSY;
retry:
- err = 0;
retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags);
if (retval) {
@@ -569,6 +568,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
pg->flags |= ALUA_RTPG_EXT_HDR_UNSUPP;
goto retry;
}
+ err = SCSI_DH_IO;
/*
* Retry on ALUA state transition or if any
* UNIT ATTENTION occurred.
@@ -576,6 +576,9 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
if (sense_hdr.sense_key == NOT_READY &&
sense_hdr.asc == 0x04 && sense_hdr.ascq == 0x0a)
err = SCSI_DH_RETRY;
+ if (sense_hdr.sense_key == ILLEGAL_REQUEST &&
+ sense_hdr.asc == 0x25 && sense_hdr.ascq == 0x00)
+ err = SCSI_DH_DEV_OFFLINED;
else if (sense_hdr.sense_key == UNIT_ATTENTION)
err = SCSI_DH_RETRY;
if (err == SCSI_DH_RETRY &&
@@ -591,7 +594,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
scsi_print_sense_hdr(sdev, ALUA_DH_NAME, &sense_hdr);
kfree(buff);
pg->expiry = 0;
- return SCSI_DH_IO;
+ return err;
}
len = get_unaligned_be32(&buff[0]) + 4;
--
2.12.2
next prev parent reply other threads:[~2017-04-28 13:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 13:06 [PATCH 0/3] failover fixes for scsi_dh_alua Martin Wilck
2017-04-28 13:06 ` [PATCH 1/3] scsi_dh_alua: Do not modify the interval value for retries Martin Wilck
2017-04-28 18:35 ` Bart Van Assche
2017-04-28 19:49 ` Martin Wilck
2017-05-02 6:17 ` Hannes Reinecke
2017-04-28 13:06 ` Martin Wilck [this message]
2017-04-28 18:42 ` [PATCH 2/3] scsi_dh_alua: Do not retry for unmapped device Bart Van Assche
2017-04-28 19:52 ` Martin Wilck
2017-04-28 13:06 ` [PATCH 3/3] scsi_dh_alua: do not call BUG_ON when updating port group Martin Wilck
2017-04-28 19:58 ` 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=20170428130626.32162-3-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=Bart.VanAssche@sandisk.com \
--cc=hare@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mauricfo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox