public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix transport class oops
@ 2005-11-06 17:47 James Bottomley
  0 siblings, 0 replies; only message in thread
From: James Bottomley @ 2005-11-06 17:47 UTC (permalink / raw)
  To: SCSI Mailing List

There's an oops that sometimes shows up with SCSI transport classes in
sysfs_hash_and_remove.  The problem is that now, because of the class to
device and vice versa symlinks, all classes have to be removed from
visibility *before* the device is removed from visibility.

The transport class trigger points violate this, so bring them back into
conformance.

James

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -691,16 +691,19 @@ int scsi_sysfs_add_sdev(struct scsi_devi
 
 void __scsi_remove_device(struct scsi_device *sdev)
 {
+	struct device *dev = &sdev->sdev_gendev;
+
 	if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
 		return;
 
 	class_device_unregister(&sdev->sdev_classdev);
-	device_del(&sdev->sdev_gendev);
+	transport_remove_device(dev);
+	device_del(dev);
 	scsi_device_set_state(sdev, SDEV_DEL);
 	if (sdev->host->hostt->slave_destroy)
 		sdev->host->hostt->slave_destroy(sdev);
-	transport_unregister_device(&sdev->sdev_gendev);
-	put_device(&sdev->sdev_gendev);
+	transport_destroy_device(dev);
+	put_device(dev);
 }
 
 /**



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

only message in thread, other threads:[~2005-11-06 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-06 17:47 [PATCH] Fix transport class oops James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox