scsi: core: Retry INQUIRY after timeout
authorMike Christie <michael.christie@oracle.com>
Tue, 23 Jan 2024 00:22:04 +0000 (18:22 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 30 Jan 2024 02:20:53 +0000 (21:20 -0500)
Description from: Martin Wilck <mwilck@suse.com>:

The SCSI mid layer doesn't retry commands after DID_TIME_OUT (see
scsi_noretry_cmd()). Packet loss in the fabric can cause spurious timeouts
during SCSI device probing, causing device probing to fail. This has been
observed in FCoE uplink failover tests, for example.

This patch fixes the issue by retrying the INQUIRY.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20240123002220.129141-4-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_scan.c

index a2bed0dbf9967af6e310ef9b7c797262c6d6f849..8ded08f37337e38bbbb5f34cdc011cbfa28830fa 100644 (file)
@@ -665,6 +665,10 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
                        .asc = 0x29,
                        .result = SAM_STAT_CHECK_CONDITION,
                },
+               {
+                       .allowed = 1,
+                       .result = DID_TIME_OUT << 16,
+               },
                {}
        };
        struct scsi_failures failures = {