Skip to content

Commit

Permalink
libata: fix EH action overwriting in ata_eh_reset()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Aug 22, 2008
1 parent eb3a55a commit a674050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a674050

Please sign in to comment.