scsi: core: Allow the ALUA transitioning state enough time
authorBrian Bunker <brian@purestorage.com>
Fri, 29 Jul 2022 21:41:10 +0000 (14:41 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 12 Aug 2022 02:00:28 +0000 (22:00 -0400)
commit54249306e2776774ccb827969e62d34570f991db
treea3a67a76d6decac2c1274939829906a61de7d881
parent53661ded2460b414644532de6b99bd87f71987e9
scsi: core: Allow the ALUA transitioning state enough time

The error path for the SCSI check condition of not ready, target in ALUA
state transition, will result in the failure of that path after the retries
are exhausted. In most cases that is well ahead of the transition timeout
established in the SCSI ALUA device handler.

Instead, reprep the command and re-add it to the queue after a 1 second
delay. This will allow the handler to take care of the timeout and only
fail the path if the target has exceeded the transition expiry timeout
(default 60 seconds). If the expiry timeout is exceeded, the handler will
change the path state from transitioning to standby leading to a path
failure eliminating the potential of this re-prep to continue endlessly. In
most cases the target will exit the transitioning state well before the
expiry timeout but after the retries are exhausted as mentioned.

Additionally remove the scsi_io_completion_reprep() function which provides
little value.

Link: https://lore.kernel.org/r/20220729214110.58576-1-brian@purestorage.com
Reviewed-by: Martin Wilck <mwilck@suse.com>
Acked-by: Krishna Kant <krishna.kant@purestorage.com>
Acked-by: Seamus Connor <sconnor@purestorage.com>
Signed-off-by: Brian Bunker <brian@purestorage.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c