libata: fix EH action overwriting in ata_eh_reset()
authorTejun Heo <tj@kernel.org>
Thu, 31 Jul 2008 07:07:04 +0000 (16:07 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 22 Aug 2008 06:19:39 +0000 (02:19 -0400)
ehc->i.action got accidentally overwritten to ATA_EH_HARD/SOFTRESET in
ata_eh_reset().  The original intention was to clear reset action
which wasn't selected.  This can cause unexpected behavior when other
EH actions are scheduled together with reset.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-eh.c

index a570ca47e239918c00f34a6773c7e3fe5890b096..c98909ba0b1c6eab3613727d501255f38c0234de 100644 (file)
@@ -2251,10 +2251,10 @@ int ata_eh_reset(struct ata_link *link, int classify,
        ehc->i.action &= ~ATA_EH_RESET;
        if (hardreset) {
                reset = hardreset;
-               ehc->i.action = ATA_EH_HARDRESET;
+               ehc->i.action |= ATA_EH_HARDRESET;
        } else if (softreset) {
                reset = softreset;
-               ehc->i.action = ATA_EH_SOFTRESET;
+               ehc->i.action |= ATA_EH_SOFTRESET;
        }
 
        if (prereset) {