Skip to contentSkip to conversation

scsi: scsi_dh_alua: increase default ALUA timeout to maximum spec value

PATCH Superseded Brian Bunker 3 participants 4 messages Apr 16 – Apr 21 SCSI

lore
Share & tools
lore
#0 lore raw

v4 cover scsi: scsi_dh_alua: increase default ALUA timeout to maximum spec value

The ALUA handler already maps a 0 value (no implicit transition timeout provided by the target) to the ALUA_FAILOVER_TIMEOUT constant. This means the kernel is already saying it won't accept an infinite transition time - it substitutes a finite default instead.

It has been suggested that some arrays may take tens of minutes to complete transitions, but even today those would be broken by the current 0-to-60-second translation. The kernel currently caps this.

The SCSI specification allows the implicit transition timeout to be specified as a single byte, meaning the maximum explicit value is 255 seconds. This patch simply changes the default from an arbitrary 60 seconds to 255, the highest value that could be explicitly provided by the target per the spec.

This is a minimal, safe change: we're not removing the cap, just raising the default to match what the spec allows.

Brian Bunker (1):
scsi: scsi_dh_alua: increase default ALUA timeout to maximum spec
value

 drivers/scsi/device_handler/scsi_dh_alua.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.50.1 (Apple Git-155)
#1 lore raw

PATCH v4 1/1 scsi: scsi_dh_alua: increase default ALUA timeout to maximum spec value

The ALUA handler maps a 0 value (no implicit transition timeout provided by the target) to the ALUA_FAILOVER_TIMEOUT constant, currently 60 seconds. This means the kernel already does not accept an infinite transition time.

However, 60 seconds is insufficient for some arrays that may take longer to complete ALUA transitions. Since the highest value allowed by the SCSI specification for the implicit transition timeout is a single byte (255 seconds), change the default to 255. This way, when a target does not provide an explicit transition timeout, we default to the maximum value the spec allows rather than an arbitrary 60 second limit.

---
 drivers/scsi/device_handler/scsi_dh_alua.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/device_handler/scsi_dh_alua.c +1 -1
index efb08b9b145a1..80ab0ff921d43 100644
@@ -37,7 +37,7 @@
 #define TPGS_MODE_EXPLICIT		0x2
 
 #define ALUA_RTPG_SIZE			128
-#define ALUA_FAILOVER_TIMEOUT		60
+#define ALUA_FAILOVER_TIMEOUT		255	/* max 255 (8-bit value) */
 #define ALUA_FAILOVER_RETRIES		5
 #define ALUA_RTPG_DELAY_MSECS		5
 #define ALUA_RTPG_RETRY_DELAY		2
Signature · 1 line
2.50.1 (Apple Git-155)
Reviewed-by on v4 1/1
#2 lore raw
Quoted 25 lines · Brian Bunker

The ALUA handler maps a 0 value (no implicit transition timeout provided by the target) to the ALUA_FAILOVER_TIMEOUT constant, currently 60 seconds. This means the kernel already does not accept an infinite transition time.

However, 60 seconds is insufficient for some arrays that may take longer to complete ALUA transitions. Since the highest value allowed by the SCSI specification for the implicit transition timeout is a single byte (255 seconds), change the default to 255. This way, when a target does not provide an explicit transition timeout, we default to the maximum value the spec allows rather than an arbitrary 60 second limit.

---
  drivers/scsi/device_handler/scsi_dh_alua.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/device_handler/scsi_dh_alua.c +0 -0
index efb08b9b145a1..80ab0ff921d43 100644

drivers/scsi/device_handler/scsi_dh_alua.c line 43

Quoted 8 lines
drivers/scsi/device_handler/scsi_dh_alua.c +1 -1
@@ -37,7 +37,7 @@
  #define TPGS_MODE_EXPLICIT		0x2
 
  #define ALUA_RTPG_SIZE			128
-#define ALUA_FAILOVER_TIMEOUT		60
+#define ALUA_FAILOVER_TIMEOUT		255	/* max 255 (8-bit value) */
  #define ALUA_FAILOVER_RETRIES		5
  #define ALUA_RTPG_DELAY_MSECS		5
  #define ALUA_RTPG_RETRY_DELAY		2

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
#3 lore raw
In reply to Brian Bunker

Brian,

Quoted 4 lines

The ALUA handler maps a 0 value (no implicit transition timeout provided by the target) to the ALUA_FAILOVER_TIMEOUT constant, currently 60 seconds. This means the kernel already does not accept an infinite transition time.

Applied to 7.1/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen