mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 14:04:27 -04:00
scsi: sd: Fix sd_done() sense handling condition
Only enter the sense_key switch when the command returned CHECK
CONDITION with valid, non-deferred sense. The old condition let deferred
or invalid sense fall through and mis-handle the I/O.
Fixes: 03aba2f795 ("[SCSI] sd/scsi_lib simplify sd_rw_intr and scsi_io_completion")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260707030333.22245-4-yangxiuwei@kylinos.cn
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
committed by
Martin K. Petersen (Oracle)
parent
bb31844d88
commit
a640d4546b
@@ -2419,8 +2419,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)
|
||||
}
|
||||
sdkp->medium_access_timed_out = 0;
|
||||
|
||||
if (!scsi_status_is_check_condition(result) &&
|
||||
(!sense_valid || sense_deferred))
|
||||
if (!scsi_status_is_check_condition(result) ||
|
||||
!sense_valid || sense_deferred)
|
||||
goto out;
|
||||
|
||||
switch (sshdr.sense_key) {
|
||||
|
||||
Reference in New Issue
Block a user