Commit 309afcb5 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

[PATCH] libata: make user scan wait for scan to complete

Make user scan wait for scan to complete.  This way user can wait for
warm plug request to complete and is prevented from causing EH event
storm by repetitively issuing scan request while EH is in progress.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Cc: Fajun Chen <fajunchen@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 722420fe
......@@ -3182,10 +3182,12 @@ static int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
rc = -EINVAL;
}
if (rc == 0)
if (rc == 0) {
ata_port_schedule_eh(ap);
spin_unlock_irqrestore(ap->lock, flags);
spin_unlock_irqrestore(ap->lock, flags);
ata_port_wait_eh(ap);
} else
spin_unlock_irqrestore(ap->lock, flags);
return rc;
}
......
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