Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:10 +0200
commitd83beba5bb37d65fba4995c25f31a3d414a5acf8 (patch)
tree435a70f82b3ce9c9ec624e15b872f16f461f3922
parent03f32ba91c28caf2683535334b109554b19c06e5 (diff)
scsi: scsi_dh_alua: always use a 2 second delay before retrying
RTPG (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.9-109-scsi-scsi_dh_alua-always-use-a-2-second-delay-b.patch65
-rw-r--r--series.conf1
2 files changed, 66 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-109-scsi-scsi_dh_alua-always-use-a-2-second-delay-b.patch b/patches.kernel.org/5.2.9-109-scsi-scsi_dh_alua-always-use-a-2-second-delay-b.patch
new file mode 100644
index 0000000000..ffc14e49dd
--- /dev/null
+++ b/patches.kernel.org/5.2.9-109-scsi-scsi_dh_alua-always-use-a-2-second-delay-b.patch
@@ -0,0 +1,65 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Fri, 12 Jul 2019 08:53:47 +0200
+Subject: [PATCH] scsi: scsi_dh_alua: always use a 2 second delay before
+ retrying RTPG
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 20122994e38aef0ae50555884d287adde6641c94
+
+[ Upstream commit 20122994e38aef0ae50555884d287adde6641c94 ]
+
+Retrying immediately after we've received a 'transitioning' sense code is
+pretty much pointless, we should always use a delay before retrying. So
+ensure the default delay is applied before retrying.
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Tested-by: Zhangguanghui <zhang.guanghui@h3c.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/scsi/device_handler/scsi_dh_alua.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
+index f0066f8a1786..4971104b1817 100644
+--- a/drivers/scsi/device_handler/scsi_dh_alua.c
++++ b/drivers/scsi/device_handler/scsi_dh_alua.c
+@@ -40,6 +40,7 @@
+ #define ALUA_FAILOVER_TIMEOUT 60
+ #define ALUA_FAILOVER_RETRIES 5
+ #define ALUA_RTPG_DELAY_MSECS 5
++#define ALUA_RTPG_RETRY_DELAY 2
+
+ /* device handler flags */
+ #define ALUA_OPTIMIZE_STPG 0x01
+@@ -682,7 +683,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
+ case SCSI_ACCESS_STATE_TRANSITIONING:
+ if (time_before(jiffies, pg->expiry)) {
+ /* State transition, retry */
+- pg->interval = 2;
++ pg->interval = ALUA_RTPG_RETRY_DELAY;
+ err = SCSI_DH_RETRY;
+ } else {
+ struct alua_dh_data *h;
+@@ -807,6 +808,8 @@ static void alua_rtpg_work(struct work_struct *work)
+ spin_lock_irqsave(&pg->lock, flags);
+ pg->flags &= ~ALUA_PG_RUNNING;
+ pg->flags |= ALUA_PG_RUN_RTPG;
++ if (!pg->interval)
++ pg->interval = ALUA_RTPG_RETRY_DELAY;
+ spin_unlock_irqrestore(&pg->lock, flags);
+ queue_delayed_work(kaluad_wq, &pg->rtpg_work,
+ pg->interval * HZ);
+@@ -818,6 +821,8 @@ static void alua_rtpg_work(struct work_struct *work)
+ spin_lock_irqsave(&pg->lock, flags);
+ if (err == SCSI_DH_RETRY || pg->flags & ALUA_PG_RUN_RTPG) {
+ pg->flags &= ~ALUA_PG_RUNNING;
++ if (!pg->interval && !(pg->flags & ALUA_PG_RUN_RTPG))
++ pg->interval = ALUA_RTPG_RETRY_DELAY;
+ pg->flags |= ALUA_PG_RUN_RTPG;
+ spin_unlock_irqrestore(&pg->lock, flags);
+ queue_delayed_work(kaluad_wq, &pg->rtpg_work,
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 4d0f0f9ad6..0b890b99d8 100644
--- a/series.conf
+++ b/series.conf
@@ -1129,6 +1129,7 @@
patches.kernel.org/5.2.9-106-ARM-dts-bcm-bcm47094-add-missing-cells-for-mdio.patch
patches.kernel.org/5.2.9-107-scsi-megaraid_sas-fix-panic-on-loading-firmware.patch
patches.kernel.org/5.2.9-108-scsi-ibmvfc-fix-WARN_ON-during-event-pool-relea.patch
+ patches.kernel.org/5.2.9-109-scsi-scsi_dh_alua-always-use-a-2-second-delay-b.patch
########################################################
# Build fixes that apply to the vanilla kernel too.