Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.com>2016-05-11 10:19:34 +0200
committerMichal Marek <mmarek@suse.com>2016-05-11 10:19:34 +0200
commitc1dfafb240871ec3477965a86968e27657f14e34 (patch)
tree2078cfd0c6dcf452f5d7484d17a69a05d528e031
parent4a09d3b8ab3bd8c6f903b0ec91b0f6d3134a778d (diff)
parent35854e5dfe59e208a741750e5ec817ce7304d339 (diff)
Merge branch 'users/hare/SLE12-SP2/for-next' into SLE12-SP2
Pull scsi fixes from Hannes Reinecke (bsc#977572).
-rw-r--r--patches.fixes/scsi_dh_alua-do-not-fail-for-unknown-VPD-identificat.patch84
-rw-r--r--patches.fixes/scsi_lib-Decode-T10-vendor-IDs.patch59
-rw-r--r--series.conf2
3 files changed, 145 insertions, 0 deletions
diff --git a/patches.fixes/scsi_dh_alua-do-not-fail-for-unknown-VPD-identificat.patch b/patches.fixes/scsi_dh_alua-do-not-fail-for-unknown-VPD-identificat.patch
new file mode 100644
index 0000000000..c4cd9befd2
--- /dev/null
+++ b/patches.fixes/scsi_dh_alua-do-not-fail-for-unknown-VPD-identificat.patch
@@ -0,0 +1,84 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Fri, 6 May 2016 10:34:35 +0200
+Subject: scsi_dh_alua: do not fail for unknown VPD identification
+Patch-Mainline: Queued in subsystem maintainer repo
+Git-commit: fe8b9534a0a0356f8a76467e2c561194bdb53c84
+Git-repo: git://git.kernel.org/mkp/h/4.7/scsi-queue
+References: bsc#977572
+
+Not every device will return a useable VPD identification, but still
+might support ALUA. Rather than disable ALUA support we should be
+allowing the device identification to be empty and attach individual
+ALUA device handler to each devices.
+
+[mkp: Fixed typo reported by Bart]
+
+Reported-by: Paul Mackerras <paulus@ozlabs.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Tested-by: Paul Mackerras <paulus@ozlabs.org>
+Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/device_handler/scsi_dh_alua.c | 25 +++++++++++++++++--------
+ 1 file changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
+index 8eaed05..b60fb6c 100644
+--- a/drivers/scsi/device_handler/scsi_dh_alua.c
++++ b/drivers/scsi/device_handler/scsi_dh_alua.c
+@@ -195,10 +195,13 @@ struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size,
+ {
+ struct alua_port_group *pg;
+
++ if (!id_str || !id_size || !strlen(id_str))
++ return NULL;
++
+ list_for_each_entry(pg, &port_group_list, node) {
+ if (pg->group_id != group_id)
+ continue;
+- if (pg->device_id_len != id_size)
++ if (!pg->device_id_len || pg->device_id_len != id_size)
+ continue;
+ if (strncmp(pg->device_id_str, id_str, id_size))
+ continue;
+@@ -232,14 +235,14 @@ struct alua_port_group *alua_alloc_pg(struct scsi_device *sdev,
+ sizeof(pg->device_id_str));
+ if (pg->device_id_len <= 0) {
+ /*
+- * Internal error: TPGS supported but no device
+- * identifcation found. Disable ALUA support.
++ * TPGS supported but no device identification found.
++ * Generate private device identification.
+ */
+- kfree(pg);
+ sdev_printk(KERN_INFO, sdev,
+ "%s: No device descriptors found\n",
+ ALUA_DH_NAME);
+- return ERR_PTR(-ENXIO);
++ pg->device_id_str[0] = '\0';
++ pg->device_id_len = 0;
+ }
+ pg->group_id = group_id;
+ pg->tpgs = tpgs;
+@@ -354,9 +357,15 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
+ return SCSI_DH_NOMEM;
+ return SCSI_DH_DEV_UNSUPP;
+ }
+- sdev_printk(KERN_INFO, sdev,
+- "%s: device %s port group %x rel port %x\n",
+- ALUA_DH_NAME, pg->device_id_str, group_id, rel_port);
++ if (pg->device_id_len)
++ sdev_printk(KERN_INFO, sdev,
++ "%s: device %s port group %x rel port %x\n",
++ ALUA_DH_NAME, pg->device_id_str,
++ group_id, rel_port);
++ else
++ sdev_printk(KERN_INFO, sdev,
++ "%s: port group %x rel port %x\n",
++ ALUA_DH_NAME, group_id, rel_port);
+
+ /* Check for existing port group references */
+ spin_lock(&h->pg_lock);
+--
+1.8.5.6
+
diff --git a/patches.fixes/scsi_lib-Decode-T10-vendor-IDs.patch b/patches.fixes/scsi_lib-Decode-T10-vendor-IDs.patch
new file mode 100644
index 0000000000..0e72beb36d
--- /dev/null
+++ b/patches.fixes/scsi_lib-Decode-T10-vendor-IDs.patch
@@ -0,0 +1,59 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 9 May 2016 09:14:29 +0200
+Subject: scsi_lib: Decode T10 vendor IDs
+Patch-Mainline: Queued in subsystem maintainer repo
+Git-commit: d230823a1c4c3e97afd4c934b86b3975d5e20249
+Git-repo: git://git.kernel.org/mkp/h/4.7/scsi-queue
+References: bsc#977572
+
+Some arrays / HBAs will only present T10 vendor IDs, so we should be
+decoding them, too.
+
+[mkp: Fixed T10 spelling]
+
+Suggested-by: Paul Mackerras <paulus@ozlabs.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Tested-by: Paul Mackerras <paulus@ozlabs.org>
+Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/scsi_lib.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
+index 92fb930..30f4429 100644
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -3200,6 +3200,7 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len)
+ * - EUI-64 based 12-byte
+ * - NAA IEEE Registered
+ * - NAA IEEE Extended
++ * - T10 Vendor ID
+ * as longer descriptors reduce the likelyhood
+ * of identification clashes.
+ */
+@@ -3218,6 +3219,21 @@ int scsi_vpd_lun_id(struct scsi_device *sdev, char *id, size_t id_len)
+ goto next_desig;
+
+ switch (d[1] & 0xf) {
++ case 0x1:
++ /* T10 Vendor ID */
++ if (cur_id_size > d[3])
++ break;
++ /* Prefer anything */
++ if (cur_id_type > 0x01 && cur_id_type != 0xff)
++ break;
++ cur_id_size = d[3];
++ if (cur_id_size + 4 > id_len)
++ cur_id_size = id_len - 4;
++ cur_id_str = d + 4;
++ cur_id_type = d[1] & 0xf;
++ id_size = snprintf(id, id_len, "t10.%*pE",
++ cur_id_size, cur_id_str);
++ break;
+ case 0x2:
+ /* EUI-64 */
+ if (cur_id_size > d[3])
+--
+1.8.5.6
+
diff --git a/series.conf b/series.conf
index aa290cc352..be50de300f 100644
--- a/series.conf
+++ b/series.conf
@@ -1483,6 +1483,7 @@
patches.fixes/scsi-vpd-pages-are-mandatory-for-SPC-2.patch
patches.fixes/scsi_dh_alua-uninitialized-variable-in-alua_check_vp.patch
patches.fixes/scsi_dh_alua-Fix-a-recently-introduced-deadlock.patch
+ patches.fixes/scsi_dh_alua-do-not-fail-for-unknown-VPD-identificat.patch
# Handle older HPSA or CCISS boards as unsupported
patches.drivers/hpsa-mark-older-boards-as-unsupported.patch
@@ -1577,6 +1578,7 @@
patches.fixes/scsi-trace-remove-service-action-definitions.patch
patches.fixes/scsi-trace-Decode-MAINTENANCE_IN-and-MAINTENANCE_OUT.patch
patches.fixes/scsi-trace-define-ZBC_IN-and-ZBC_OUT.patch
+ patches.fixes/scsi_lib-Decode-T10-vendor-IDs.patch
patches.suse/fcoe-reduce-max_sectors
patches.fixes/0001-libfc-replace-rp_mutex-with-rp_lock.patch