Skip to contentSkip to conversation

scsi_dh_rdac: always retry MODE SELECT on command lock violation

PATCH Applied Hannes Reinecke 3 participants 5 messages Jan 22, 2016 – Feb 5, 2016 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi_dh_rdac: always retry MODE SELECT on command lock violation

If MODE SELECT returns with sense '05/91/36' (command lock violation) it should always be retried without counting the number of retries. During an HBA upgrade or similar circumstances one might see a flood of MODE SELECT command from various HBAs, which will easily trigger the sense code and exceed the retry count.

References: bsc#956949

---
 drivers/scsi/device_handler/scsi_dh_rdac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/device_handler/scsi_dh_rdac.c +3 -1
index 3613581..93880ed 100644
@@ -562,7 +562,7 @@ static int mode_select_handle_sense(struct scsi_device *sdev,
 			/*
 			 * Command Lock contention
 			 */
-			err = SCSI_DH_RETRY;
+			err = SCSI_DH_IMM_RETRY;
 		break;
 	default:
 		break;
@@ -612,6 +612,8 @@ retry:
 		err = mode_select_handle_sense(sdev, h->sense);
 		if (err == SCSI_DH_RETRY && retry_cnt--)
 			goto retry;
+		if (err == SCSI_DH_IMM_RETRY)
+			goto retry;
 	}
 	if (err == SCSI_DH_OK) {
 		h->state = RDAC_STATE_ACTIVE;
Signature · 1 line
1.8.5.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Hannes Reinecke

If MODE SELECT returns with sense '05/91/36' (command lock violation) it should always be retried without counting the number of retries. During an HBA upgrade or similar circumstances one might see a flood of MODE SELECT command from various HBAs, which will easily trigger the sense code and exceed the retry count.

References: bsc#956949

Without the bugzilla refrence

Quoted 35 lines
---
 drivers/scsi/device_handler/scsi_dh_rdac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/device_handler/scsi_dh_rdac.c +3 -1
index 3613581..93880ed 100644
@@ -562,7 +562,7 @@ static int mode_select_handle_sense(struct scsi_device *sdev,
 			/*
 			 * Command Lock contention
 			 */
-			err = SCSI_DH_RETRY;
+			err = SCSI_DH_IMM_RETRY;
 		break;
 	default:
 		break;
@@ -612,6 +612,8 @@ retry:
 		err = mode_select_handle_sense(sdev, h->sense);
 		if (err == SCSI_DH_RETRY && retry_cnt--)
 			goto retry;
+		if (err == SCSI_DH_IMM_RETRY)
+			goto retry;
 	}
 	if (err == SCSI_DH_OK) {
 		h->state = RDAC_STATE_ACTIVE;
Signature · 6 lines
1.8.5.6

--
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
Signature · 10 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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
#2 lore raw
In reply to Hannes Reinecke
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Hannes" == Hannes Reinecke <[email protected]> writes:

Hannes> If MODE SELECT returns with sense '05/91/36' (command lock Hannes> violation) it should always be retried without counting the Hannes> number of retries. During an HBA upgrade or similar Hannes> circumstances one might see a flood of MODE SELECT command from Hannes> various HBAs, which will easily trigger the sense code and Hannes> exceed the retry count.

Should this be Cc: stable?

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
Quoted 11 lines · Martin K. Petersen
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Hannes" == Hannes Reinecke <[email protected]> writes:

Hannes> If MODE SELECT returns with sense '05/91/36' (command lock Hannes> violation) it should always be retried without counting the Hannes> number of retries. During an HBA upgrade or similar Hannes> circumstances one might see a flood of MODE SELECT command from Hannes> various HBAs, which will easily trigger the sense code and Hannes> exceed the retry count.

Should this be Cc: stable?

Probably, yes.

Can you do it?

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (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
In reply to Hannes Reinecke
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Hannes" == Hannes Reinecke <[email protected]> writes:

Hannes> If MODE SELECT returns with sense '05/91/36' (command lock Hannes> violation) it should always be retried without counting the Hannes> number of retries. During an HBA upgrade or similar Hannes> circumstances one might see a flood of MODE SELECT command from Hannes> various HBAs, which will easily trigger the sense code and Hannes> exceed the retry count.

Applied to 4.5/scsi-fixes.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering