Skip to content

Commit 1946436

Browse files
Gwendal Grignougregkh
Gwendal Grignou
authored andcommitted
libata: make ata_eh_qc_retry() bump scmd->allowed on bogus failures
commit f13e220 upstream. libata EH decrements scmd->retries when the command failed for reasons unrelated to the command itself so that, for example, commands aborted due to suspend / resume cycle don't get penalized; however, decrementing scmd->retries isn't enough for ATA passthrough commands. Without this fix, ATA passthrough commands are not resend to the drive, and no error is signalled to the caller because: - allowed retry count is 1 - ata_eh_qc_complete fill the sense data, so result is valid - sense data is filled with untouched ATA registers. Signed-off-by: Gwendal Grignou <[email protected]> Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 01e608d commit 1946436

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/ata/libata-eh.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,14 +1322,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc)
13221322
* should be retried. To be used from EH.
13231323
*
13241324
* SCSI midlayer limits the number of retries to scmd->allowed.
1325-
* scmd->retries is decremented for commands which get retried
1325+
* scmd->allowed is incremented for commands which get retried
13261326
* due to unrelated failures (qc->err_mask is zero).
13271327
*/
13281328
void ata_eh_qc_retry(struct ata_queued_cmd *qc)
13291329
{
13301330
struct scsi_cmnd *scmd = qc->scsicmd;
1331-
if (!qc->err_mask && scmd->retries)
1332-
scmd->retries--;
1331+
if (!qc->err_mask)
1332+
scmd->allowed++;
13331333
__ata_eh_qc_complete(qc);
13341334
}
13351335

0 commit comments

Comments
 (0)