linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: move target_destroy call
@ 2006-03-14 19:18 Mike Anderson
  0 siblings, 0 replies; only message in thread
From: Mike Anderson @ 2006-03-14 19:18 UTC (permalink / raw)
  To: linux-scsi

This patch moves the calling of target_destroy next to the list_del. This
closed a race being seen while doing a device add on the aic7xxx.

Signed-off-by: Mike Anderson <andmike@us.ibm.com>

 drivers/scsi/scsi_scan.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Index: aic94xx-sas-2.6-patched/drivers/scsi/scsi_scan.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/scsi_scan.c	2006-03-12 14:39:27.000000000 -0800
+++ aic94xx-sas-2.6-patched/drivers/scsi/scsi_scan.c	2006-03-14 11:09:00.000000000 -0800
@@ -288,10 +288,7 @@ static void scsi_target_dev_release(stru
 {
 	struct device *parent = dev->parent;
 	struct scsi_target *starget = to_scsi_target(dev);
-	struct Scsi_Host *shost = dev_to_shost(parent);
 
-	if (shost->hostt->target_destroy)
-		shost->hostt->target_destroy(starget);
 	kfree(starget);
 	put_device(parent);
 }
@@ -416,6 +413,8 @@ static void scsi_target_reap_usercontext
 	device_del(&starget->dev);
 	transport_destroy_device(&starget->dev);
 	spin_lock_irqsave(shost->host_lock, flags);
+	if (shost->hostt->target_destroy)
+		shost->hostt->target_destroy(starget);
 	list_del_init(&starget->siblings);
 	spin_unlock_irqrestore(shost->host_lock, flags);
 	put_device(&starget->dev);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-14 19:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-14 19:18 [PATCH] scsi: move target_destroy call Mike Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).