Skip to content

Commit 9800657

Browse files
author
CKI KWF Bot
committed
Merge: scsi: core: Fix command pass through retry regression
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-9/-/merge_requests/3285 JIRA: https://issues.redhat.com/browse/RHEL-77122 Upstream Status: From upstream linux mainline 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: 994724e ("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> (cherry picked from commit 8604f63) Signed-off-by: Ewan D. Milne <emilne@redhat.com> Closes RHEL-77122 Approved-by: Chris Leech <cleech@redhat.com> Approved-by: John Meneghini <jmeneghi@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>
2 parents 77638bd + f8d9901 commit 9800657

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ static int scsi_check_passthrough(struct scsi_cmnd *scmd,
210210
struct scsi_sense_hdr sshdr;
211211
enum sam_status status;
212212

213+
if (!scmd->result)
214+
return 0;
215+
213216
if (!failures)
214217
return 0;
215218

0 commit comments

Comments
 (0)