Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-10-12 12:14:58 +0200
committerHannes Reinecke <hare@suse.de>2018-10-12 12:40:40 +0200
commitd3511aeaf82d52a905e1a7a7bbc5c5b08af33746 (patch)
treefdaa3862f75a5c795d194153f71ec0485125b162
parentba7815c3bbac90608a18cf984a8131e07b1b3160 (diff)
scsi: qla2xxx: Fix duplicate switch database entries
(bsc#1108870).
-rw-r--r--patches.fixes/scsi-qla2xxx-Fix-duplicate-switch-database-entries.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.fixes/scsi-qla2xxx-Fix-duplicate-switch-database-entries.patch b/patches.fixes/scsi-qla2xxx-Fix-duplicate-switch-database-entries.patch
new file mode 100644
index 0000000000..255b8c9ac9
--- /dev/null
+++ b/patches.fixes/scsi-qla2xxx-Fix-duplicate-switch-database-entries.patch
@@ -0,0 +1,43 @@
+From: Quinn Tran <quinn.tran@cavium.com>
+Date: Wed, 26 Sep 2018 22:05:13 -0700
+Subject: [PATCH] scsi: qla2xxx: Fix duplicate switch database entries
+Git-commit: 732ee9a912cf2d9a50c5f9c4213cdc2f885d6aa6
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
+Patch-mainline: Queued in subsystem maintainer repository
+References: bsc#1108870
+
+The response data buffer used in switch scan is reused 4 times. (For example,
+for commands GPN_FT, GNN_FT for FCP and FC-NVME) Before driver reuses this
+buffer, clear it to prevent duplicate entries in our database.
+
+Fixes: a4239945b8ad1 ("scsi: qla2xxx: Add switch command to simplify fabric discovery"
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
+Reviewed-by: Ewan D. Milne <emilne@redhat.com>
+Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/scsi/qla2xxx/qla_gs.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
+index a24b0c2a2f00..4291e6324f8c 100644
+--- a/drivers/scsi/qla2xxx/qla_gs.c
++++ b/drivers/scsi/qla2xxx/qla_gs.c
+@@ -4193,9 +4193,9 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp)
+ sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout;
+ qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2);
+
+- rspsz = sizeof(struct ct_sns_gpnft_rsp) +
+- ((vha->hw->max_fibre_devices - 1) *
+- sizeof(struct ct_sns_gpn_ft_data));
++ rspsz = sp->u.iocb_cmd.u.ctarg.rsp_size;
++ memset(sp->u.iocb_cmd.u.ctarg.rsp, 0, sp->u.iocb_cmd.u.ctarg.rsp_size);
++ memset(sp->u.iocb_cmd.u.ctarg.req, 0, sp->u.iocb_cmd.u.ctarg.req_size);
+
+ ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
+ /* CT_IU preamble */
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 579108e674..4be7a21287 100644
--- a/series.conf
+++ b/series.conf
@@ -17923,6 +17923,7 @@
patches.fixes/scsi-qla2xxx-don-t-allow-negative-thresholds.patch
patches.fixes/scsi-qla2xxx-Fix-NVMe-session-hang-on-unload.patch
patches.fixes/scsi-qla2xxx-Fix-NVMe-Target-discovery.patch
+ patches.fixes/scsi-qla2xxx-Fix-duplicate-switch-database-entries.patch
# git://git.infradead.org/nvme.git nvme-4.20
patches.fixes/nvme_fc-add-nvme_discovery-sysfs-attribute-to-fc-tra.patch