Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=75f9cafc2d24a1cf44d7c3f3e5b4f7a393afcf71
Commit:     75f9cafc2d24a1cf44d7c3f3e5b4f7a393afcf71
Parent:     b710a1f4b34438b624e9c6c2dc8bcf54b0b0ba27
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 3 01:21:14 2008 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Wed Jan 23 05:24:17 2008 -0500

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 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 4195526..4e31071 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -61,12 +61,11 @@ enum {
        ATA_ECAT_ATA_BUS                = 1,
        ATA_ECAT_TOUT_HSM               = 2,
        ATA_ECAT_UNK_DEV                = 3,
-       ATA_ECAT_DUBIOUS_ATA_BUS        = 4,
-       ATA_ECAT_DUBIOUS_TOUT_HSM       = 5,
-       ATA_ECAT_DUBIOUS_UNK_DEV        = 6,
-       ATA_ECAT_NR                     = 7,
-
-       ATA_ECAT_DUBIOUS_BASE           = ATA_ECAT_DUBIOUS_ATA_BUS,
+       ATA_ECAT_DUBIOUS_NONE           = 4,
+       ATA_ECAT_DUBIOUS_ATA_BUS        = 5,
+       ATA_ECAT_DUBIOUS_TOUT_HSM       = 6,
+       ATA_ECAT_DUBIOUS_UNK_DEV        = 7,
+       ATA_ECAT_NR                     = 8,
 };
 
 /* 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,
                *xfer_ok = 1;
 
        if (!*xfer_ok)
-               base = ATA_ECAT_DUBIOUS_BASE;
+               base = ATA_ECAT_DUBIOUS_NONE;
 
        if (err_mask & AC_ERR_ATA_BUS)
                return base + ATA_ECAT_ATA_BUS;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to