diff options
author | Tejun Heo <htejun@gmail.com> | 2008-01-02 11:21:14 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-01-23 05:24:17 -0500 |
commit | 75f9cafc2d24a1cf44d7c3f3e5b4f7a393afcf71 (patch) | |
tree | a98170f1fae07fbb169f21b5391cc2edadbb697d /drivers/ata/libata-eh.c | |
parent | b710a1f4b34438b624e9c6c2dc8bcf54b0b0ba27 (diff) |
libata: fix off-by-one in error categorization
ATA_ECAT_DUBIOUS_BASE was too high by one and thus all DUBIOUS error
categorizations were wrong. This passed test because only ATA_BUS and
UNK_DEV were used during testing and the ones after them - ATA_BUS and
an overflowed entry - behaved similarly.
This patch fixes the problem by adding DUBIOUS_NONE category and use
it as base.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 419552603a16..4e31071acc02 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -61,12 +61,11 @@ enum { | |||
61 | ATA_ECAT_ATA_BUS = 1, | 61 | ATA_ECAT_ATA_BUS = 1, |
62 | ATA_ECAT_TOUT_HSM = 2, | 62 | ATA_ECAT_TOUT_HSM = 2, |
63 | ATA_ECAT_UNK_DEV = 3, | 63 | ATA_ECAT_UNK_DEV = 3, |
64 | ATA_ECAT_DUBIOUS_ATA_BUS = 4, | 64 | ATA_ECAT_DUBIOUS_NONE = 4, |
65 | ATA_ECAT_DUBIOUS_TOUT_HSM = 5, | 65 | ATA_ECAT_DUBIOUS_ATA_BUS = 5, |
66 | ATA_ECAT_DUBIOUS_UNK_DEV = 6, | 66 | ATA_ECAT_DUBIOUS_TOUT_HSM = 6, |
67 | ATA_ECAT_NR = 7, | 67 | ATA_ECAT_DUBIOUS_UNK_DEV = 7, |
68 | 68 | ATA_ECAT_NR = 8, | |
69 | ATA_ECAT_DUBIOUS_BASE = ATA_ECAT_DUBIOUS_ATA_BUS, | ||
70 | }; | 69 | }; |
71 | 70 | ||
72 | /* Waiting in ->prereset can never be reliable. It's sometimes nice | 71 | /* Waiting in ->prereset can never be reliable. It's sometimes nice |
@@ -1499,7 +1498,7 @@ static int ata_eh_categorize_error(unsigned int eflags, unsigned int err_mask, | |||
1499 | *xfer_ok = 1; | 1498 | *xfer_ok = 1; |
1500 | 1499 | ||
1501 | if (!*xfer_ok) | 1500 | if (!*xfer_ok) |
1502 | base = ATA_ECAT_DUBIOUS_BASE; | 1501 | base = ATA_ECAT_DUBIOUS_NONE; |
1503 | 1502 | ||
1504 | if (err_mask & AC_ERR_ATA_BUS) | 1503 | if (err_mask & AC_ERR_ATA_BUS) |
1505 | return base + ATA_ECAT_ATA_BUS; | 1504 | return base + ATA_ECAT_ATA_BUS; |