]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: core: Fix command pass through retry regression
authorMike Christie <michael.christie@oracle.com>
Tue, 7 Jan 2025 01:02:20 +0000 (19:02 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 10 Jan 2025 01:56:19 +0000 (20:56 -0500)
commit8604f633f59375687fa115d6f691de95a42520e3
tree344bae72877afabfdc9c5b2de036214d07d21d49
parent3b2f56860b05bf0cea86af786fd9b7faa8fe3ef3
scsi: core: Fix command pass through retry regression

scsi_check_passthrough() is always called, but it doesn't check for if a
command completed successfully. As a result, if a command was successful and
the caller used SCMD_FAILURE_RESULT_ANY to indicate what failures it wanted
to retry, we will end up retrying the command. This will cause delays during
device discovery because of the command being sent multiple times. For some
USB devices it can also cause the wrong device size to be used.

This patch adds a check for if the command was successful. If it is we
return immediately instead of trying to match a failure.

Fixes: 994724e6b3f0 ("scsi: core: Allow passthrough to request midlayer retries")
Reported-by: Kris Karas <bugs-a21@moonlit-rail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219652
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20250107010220.7215-1-michael.christie@oracle.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c