Skip to contentSkip to conversation

scsi dh alua: fix group id masking

PATCH In review [email protected] 2 participants 7 messages Jan 30, 2009 – Feb 6, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 scsi dh alua: fix group id masking

From: Ilgu Hong <[email protected]>

The buf[i] is a byte but we are only asking 4 bits off the group_id. This patch has us take off a byte.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +2 -2
index e356b43..5096b0b 100644
@@ -247,8 +247,8 @@ static unsigned submit_stpg(struct scsi_device *sdev, struct alua_dh_data *h)
 	/* Prepare the data buffer */
 	memset(h->buff, 0, stpg_len);
 	h->buff[4] = TPGS_STATE_OPTIMIZED & 0x0f;
-	h->buff[6] = (h->group_id >> 8) & 0x0f;
-	h->buff[7] = h->group_id & 0x0f;
+	h->buff[6] = (h->group_id >> 8) & 0xff;
+	h->buff[7] = h->group_id & 0xff;
 
 	rq = get_alua_req(sdev, h->buff, stpg_len, WRITE);
 	if (!rq)
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 2/3 scsi dh alua: add intel Multi-Flex device

From: Ilgu Hong <[email protected]>

This adds the Intel Multi-Flex device to scsi_dh_alua's scsi_dh_devlist, so the module attaches to these devs.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +1 -0
index 5096b0b..31e1df5 100644
@@ -691,6 +691,7 @@ static const struct scsi_dh_devlist alua_dev_list[] = {
 	{"IBM", "2107900" },
 	{"IBM", "2145" },
 	{"Pillar", "Axiom" },
+	{"Intel", "Multi-Flex"},
 	{NULL, NULL}
 };
 
Signature · 1 line
1.6.0.6
#2 lore raw

PATCH 3/3 scsi dh alua: handle report luns data changed in check sense callout

From: Ilgu Hong <[email protected]>

When we switch controllers the Intel Multi-Flex reports REPORTED_LUNS_DATA_HAS_CHANGED. This patch just has us retry the command.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +9 -0
index 31e1df5..dba154c 100644
@@ -461,6 +461,15 @@ static int alua_check_sense(struct scsi_device *sdev,
 			 */
 			return ADD_TO_MLQUEUE;
 		}
+		if (sense_hdr->asc == 0x3f && sense_hdr->ascq == 0x0e) {
+			/*
+			 * REPORTED_LUNS_DATA_HAS_CHANGED is reported
+			 * when switching controllers on targets like
+			 * Intel Multi-Flex. We can just retry.
+			 */
+			return ADD_TO_MLQUEUE;
+		}
+
 		break;
 	}
 
Signature · 1 line
1.6.0.6
#3 lore raw

Re: [PATCH 3/3] scsi dh alua: handle report luns data changed in check sense callout

Hi Mike,

Quoted 22 lines · [email protected] wrote:

From: Ilgu Hong <[email protected]>

When we switch controllers the Intel Multi-Flex reports REPORTED_LUNS_DATA_HAS_CHANGED. This patch just has us retry the command.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +2 -0
index 31e1df5..dba154c 100644
@@ -461,6 +461,15 @@ static int alua_check_sense(struct scsi_device *sdev,
 			 */
 			return ADD_TO_MLQUEUE;
 		}
+		if (sense_hdr->asc == 0x3f && sense_hdr->ascq == 0x0e) {
+			/*

drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_sense(struct scsi_device *sdev, · line 475

Quoted 10 lines
drivers/scsi/device_handler/scsi_dh_alua.c +7 -0
+			 * REPORTED_LUNS_DATA_HAS_CHANGED is reported
+			 * when switching controllers on targets like
+			 * Intel Multi-Flex. We can just retry.
+			 */
+			return ADD_TO_MLQUEUE;
+		}
+
 		break;
 	}
 

Hmm. We could as well always retry for Unit Attention; it's meant to be a temporary condition anyway so no harm in retrying.

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

Re: [PATCH 3/3] scsi dh alua: handle report luns data changed in check sense callout

Quoted 30 lines · Hannes Reinecke

Hi Mike,

Quoted 27 lines · [email protected] wrote:

From: Ilgu Hong <[email protected]>

When we switch controllers the Intel Multi-Flex reports REPORTED_LUNS_DATA_HAS_CHANGED. This patch just has us retry the command.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +6 -0
index 31e1df5..dba154c 100644
@@ -461,6 +461,15 @@ static int alua_check_sense(struct scsi_device 
 *sdev,
              */
             return ADD_TO_MLQUEUE;
         }
+        if (sense_hdr->asc == 0x3f && sense_hdr->ascq == 0x0e) {
+            /*
+             * REPORTED_LUNS_DATA_HAS_CHANGED is reported
+             * when switching controllers on targets like
+             * Intel Multi-Flex. We can just retry.
+             */
Quoted 9 lines

drivers/scsi/device_handler/scsi_dh_alua.c static int alua_check_sense(struct scsi_device *sdev, · line 474

Quoted 6 lines
drivers/scsi/device_handler/scsi_dh_alua.c +3 -0
+            return ADD_TO_MLQUEUE;
+        }
+
         break;
     }

Hmm. We could as well always retry for Unit Attention; it's meant to be a temporary condition anyway so no harm in retrying.

Hey, do you mean you want me to just do

case UNIT_ATTENTION:

	return ADD_TO_MLQUEUE;

? In scsi_error.c:scsi_check_sense we fail for

                /*
                 * if the device is not started, we need to wake
                 * the error handler to start the motor
                 */
                if (scmd->device->allow_restart &&
                    (sshdr.asc == 0x04) && (sshdr.ascq == 0x02))
                        return FAILED;

and in scsi_lib.c:scsi_io_compeltion we fail for

                        if (cmd->device->removable) {
                                /* Detected disc change.  Set a bit
                                 * and quietly refuse further access.
                                 */
                                cmd->device->changed = 1;
                                scsi_end_request(cmd, -EIO, this_count, 1);
                                return;
#5 lore raw

Re: [PATCH 2/3] scsi dh alua: add intel Multi-Flex device

In reply to [email protected]

Hi Mike,

Quoted 16 lines · [email protected] wrote:

From: Ilgu Hong <[email protected]>

This adds the Intel Multi-Flex device to scsi_dh_alua's scsi_dh_devlist, so the module attaches to these devs.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +0 -0
index 5096b0b..31e1df5 100644

drivers/scsi/device_handler/scsi_dh_alua.c static const struct scsi_dh_devlist alua_dev_list[] = { · line 697

Quoted 7 lines
drivers/scsi/device_handler/scsi_dh_alua.c +1 -0
@@ -691,6 +691,7 @@ static const struct scsi_dh_devlist alua_dev_list[] = {
 	{"IBM", "2107900" },
 	{"IBM", "2145" },
 	{"Pillar", "Axiom" },
+	{"Intel", "Multi-Flex"},
 	{NULL, NULL}
 };
 

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw
In reply to [email protected]

Hi Mike,

Quoted 16 lines · [email protected] wrote:

From: Ilgu Hong <[email protected]>

The buf[i] is a byte but we are only asking 4 bits off the group_id. This patch has us take off a byte.

---
 drivers/scsi/device_handler/scsi_dh_alua.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/device_handler/scsi_dh_alua.c +0 -0
index e356b43..5096b0b 100644

drivers/scsi/device_handler/scsi_dh_alua.c static unsigned submit_stpg(struct scsi_device *sdev, struct alua_dh_data *h) · line 254

Quoted 10 lines
drivers/scsi/device_handler/scsi_dh_alua.c +2 -2
@@ -247,8 +247,8 @@ static unsigned submit_stpg(struct scsi_device *sdev, struct alua_dh_data *h)
 	/* Prepare the data buffer */
 	memset(h->buff, 0, stpg_len);
 	h->buff[4] = TPGS_STATE_OPTIMIZED & 0x0f;
-	h->buff[6] = (h->group_id >> 8) & 0x0f;
-	h->buff[7] = h->group_id & 0x0f;
+	h->buff[6] = (h->group_id >> 8) & 0xff;
+	h->buff[7] = h->group_id & 0xff;
 
 	rq = get_alua_req(sdev, h->buff, stpg_len, WRITE);
 	if (!rq)

Correct.

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html