Skip to contentSkip to conversation

libata: make user scan wait for scan to complete

PATCH Applied Tejun Heo 2 participants 4 messages Sep 30, 2006 – Nov 1, 2006 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 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.

drivers/ata/libata-scsi.c +5 -3
index 3986ec8..e1fe832 100644
@@ -3138,10 +3138,12 @@ static int ata_scsi_user_scan(struct Scs
 			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;
 }
#1 lore raw
Quoted 14 lines · Tejun Heo

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.

drivers/ata/libata-scsi.c +0 -0
index 3986ec8..e1fe832 100644
@@ -3138,10 +3138,12 @@ static int ata_scsi_user_scan(struct Scs
 			rc = -EINVAL;
 	}

drivers/ata/libata-scsi.c static int ata_scsi_user_scan(struct Scs · line 3146

Quoted 10 lines
drivers/ata/libata-scsi.c +5 -3
 
-	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);

Given that we are now 2.6.19-rc1, would you say this applies to #upstream-fixes or #upstream?

I'm OK with it either way.

Jeff

author
#2 lore raw
Quoted 28 lines · Jeff Garzik
Quoted 14 lines · Tejun Heo

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.

drivers/ata/libata-scsi.c +0 -0
index 3986ec8..e1fe832 100644
@@ -3138,10 +3138,12 @@ static int ata_scsi_user_scan(struct Scs
             rc = -EINVAL;
     }

drivers/ata/libata-scsi.c static int ata_scsi_user_scan(struct Scs · line 3146

Quoted 10 lines
drivers/ata/libata-scsi.c +5 -3
 
-    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);

Given that we are now 2.6.19-rc1, would you say this applies to #upstream-fixes or #upstream?

Quoted 1 line

I'm OK with it either way.

I don't think this patch is urgent. Let's queue it in #upstream.

Signature · 1 line
tejun