diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2018-05-08 20:28:12 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2018-05-10 14:43:20 -0400 |
commit | 804689ad2d9b66d0d3920b48cf05881049d44589 (patch) | |
tree | d1b6c0151509a56f14a762438d3334412a47c154 | |
parent | 7eb49509dd6b2a4ed0c18a0f8c187afbacf98b42 (diff) |
libata: Fix command retry decision
For failed commands with valid sense data (e.g. NCQ commands),
scsi_check_sense() is used in ata_analyze_tf() to determine if the
command can be retried. In such case, rely on this decision and ignore
the command error mask based decision done in ata_worth_retry().
This fixes useless retries of commands such as unaligned writes on zoned
disks (TYPE_ZAC).
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | drivers/ata/libata-eh.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index b933357edc22..1035de1e5120 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2237,12 +2237,16 @@ static void ata_eh_link_autopsy(struct ata_link *link) | |||
2237 | if (qc->err_mask & ~AC_ERR_OTHER) | 2237 | if (qc->err_mask & ~AC_ERR_OTHER) |
2238 | qc->err_mask &= ~AC_ERR_OTHER; | 2238 | qc->err_mask &= ~AC_ERR_OTHER; |
2239 | 2239 | ||
2240 | /* SENSE_VALID trumps dev/unknown error and revalidation */ | 2240 | /* |
2241 | * SENSE_VALID trumps dev/unknown error and revalidation. Upper | ||
2242 | * layers will determine whether the command is worth retrying | ||
2243 | * based on the sense data and device class/type. Otherwise, | ||
2244 | * determine directly if the command is worth retrying using its | ||
2245 | * error mask and flags. | ||
2246 | */ | ||
2241 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) | 2247 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) |
2242 | qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); | 2248 | qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); |
2243 | 2249 | else if (ata_eh_worth_retry(qc)) | |
2244 | /* determine whether the command is worth retrying */ | ||
2245 | if (ata_eh_worth_retry(qc)) | ||
2246 | qc->flags |= ATA_QCFLAG_RETRY; | 2250 | qc->flags |= ATA_QCFLAG_RETRY; |
2247 | 2251 | ||
2248 | /* accumulate error info */ | 2252 | /* accumulate error info */ |