Skip to content

Commit

Permalink
libata: make EH fail gracefully if no reset method is available
Browse files Browse the repository at this point in the history
When no reset method is available, libata currently oopses.  Although
the condition can't happen unless there's a bug in a low level driver,
oopsing isn't the best way to report the error condition.  Complain,
dump stack and fail reset instead.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 17, 2008
1 parent b93fda1 commit 4f7faa3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2137,9 +2137,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (hardreset) {
reset = hardreset;
ehc->i.action = ATA_EH_HARDRESET;
} else {
} else if (softreset) {
reset = softreset;
ehc->i.action = ATA_EH_SOFTRESET;
} else {
ata_link_printk(link, KERN_ERR, "BUG: no reset method, "
"please report to linux-ide@vger.kernel.org\n");
dump_stack();
return -EINVAL;
}

if (prereset) {
Expand Down

0 comments on commit 4f7faa3

Please sign in to comment.