Commit c7843e8f authored by Mark Lord's avatar Mark Lord Committed by Jeff Garzik

sata_mv: safer logic for limit_warnings

There is a miniscule chance that two separate host controllers
might be in sata_mv at the same time and manage to decrement
the static limit_warnings variable below zero.

Fix the comparison to deal with it.
Signed-off-by: default avatarMark Lord <mlord@pobox.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent a836d3e8
...@@ -1607,7 +1607,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) ...@@ -1607,7 +1607,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc)
* Much of the time, this could just work regardless. * Much of the time, this could just work regardless.
* So for now, just log the incident, and allow the attempt. * So for now, just log the incident, and allow the attempt.
*/ */
if (limit_warnings && (qc->nbytes / qc->sect_size) > 1) { if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) {
--limit_warnings; --limit_warnings;
ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME ata_link_printk(qc->dev->link, KERN_WARNING, DRV_NAME
": attempting PIO w/multiple DRQ: " ": attempting PIO w/multiple DRQ: "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment