From: Tejun Heo Date: Sat, 30 Sep 2006 09:07:17 +0000 (+0900) Subject: [PATCH] libata: make user scan wait for scan to complete X-Git-Tag: v2.6.20-rc1~34^2~40^2~9^2~68 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=309afcb5c87b5a41da51cc0c36f61c0e0d43ca9a;p=linux-2.6 [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: Tejun Heo Cc: Fajun Chen Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 47ea111d5a..6b2553dae4 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -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; }