提交 4f7faa3f 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

libata: make EH fail gracefully if no reset method is available

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: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 b93fda12
...@@ -2137,9 +2137,14 @@ int ata_eh_reset(struct ata_link *link, int classify, ...@@ -2137,9 +2137,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (hardreset) { if (hardreset) {
reset = hardreset; reset = hardreset;
ehc->i.action = ATA_EH_HARDRESET; ehc->i.action = ATA_EH_HARDRESET;
} else { } else if (softreset) {
reset = softreset; reset = softreset;
ehc->i.action = ATA_EH_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) { if (prereset) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册