Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Hannes Reinecke and committed by
Martin K. Petersen
d2d06d4f 98441221

+3 -1
+3 -1
drivers/scsi/device_handler/scsi_dh_rdac.c
··· 562 562 /* 563 563 * Command Lock contention 564 564 */ 565 - err = SCSI_DH_RETRY; 565 + err = SCSI_DH_IMM_RETRY; 566 566 break; 567 567 default: 568 568 break; ··· 611 611 if (err != SCSI_DH_OK) { 612 612 err = mode_select_handle_sense(sdev, h->sense); 613 613 if (err == SCSI_DH_RETRY && retry_cnt--) 614 + goto retry; 615 + if (err == SCSI_DH_IMM_RETRY) 614 616 goto retry; 615 617 } 616 618 if (err == SCSI_DH_OK) {