summaryrefslogtreecommitdiff
path: root/scripts/dummy-tools/python3
diff options
context:
space:
mode:
authorNiklas Cassel <cassel@kernel.org>2026-10-30 10:00:48 +0100
committerNiklas Cassel <cassel@kernel.org>2026-11-02 11:37:20 +0100
commit597be4104c4045d73979c05307fa5fc778d1dbde (patch)
tree3575ce639fa8e68814f96b64e56cd459c53602cf /scripts/dummy-tools/python3
parentd7c5cc8cc21c1264cce07feb4a51be158688280e (diff)
ata: libata-eh: Retry non-NCQ commands when their sense data asks for it
When a failed command has valid sense data, ata_eh_analyze_tf() asks scsi_check_sense() whether the command should be retried, and sets ATA_QCFLAG_RETRY if it should. ata_eh_link_autopsy() then clears AC_ERR_DEV and AC_ERR_OTHER from qc->err_mask, relying on that decision. For an NCQ command, qc->err_mask still has AC_ERR_NCQ, so ata_eh_finish() honors ATA_QCFLAG_RETRY. For a non-NCQ command, whose sense data comes from REQUEST SENSE DATA EXT, qc->err_mask is now zero, and ata_eh_finish() completes the command with scmd->retries set to scmd->allowed, without looking at ATA_QCFLAG_RETRY. Such a command is thus never retried, even when its sense data asks for a retry, e.g. a transient error reported as ABORTED COMMAND. Make ata_eh_finish() honor ATA_QCFLAG_RETRY for commands with valid sense data. ata_eh_qc_retry() cannot be used for this: as qc->err_mask is zero, it increments scmd->allowed, so every retry would allow one more, and a persistent error would be retried forever. Instead, complete the command without touching scmd->allowed or scmd->retries, so that the SCSI midlayer retries it at most scmd->allowed times, like any other failed command. Fixes: 3852e3738266 ("libata: evaluate SCSI sense code") Reviewed-by: Igor Pylypiv <ipylypiv@google.com> Link: https://lore.kernel.org/r/20261030090047.407906-2-cassel@kernel.org Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions