diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-11-06 12:47:08 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-11-06 13:31:30 -0500 |
commit | df133c212ef82b9c7e80fca7b1f87dad8a05de3c (patch) | |
tree | 61d5204c553098d047edf01574ac5a2c72ab320e /drivers | |
parent | f912696ab330bf539231d1f8032320f2a08b850f (diff) |
[SCSI] Fix transport class oops
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.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 72a6550a056c..46349293de08 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -691,16 +691,19 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) | |||
691 | 691 | ||
692 | void __scsi_remove_device(struct scsi_device *sdev) | 692 | void __scsi_remove_device(struct scsi_device *sdev) |
693 | { | 693 | { |
694 | struct device *dev = &sdev->sdev_gendev; | ||
695 | |||
694 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) | 696 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) |
695 | return; | 697 | return; |
696 | 698 | ||
697 | class_device_unregister(&sdev->sdev_classdev); | 699 | class_device_unregister(&sdev->sdev_classdev); |
698 | device_del(&sdev->sdev_gendev); | 700 | transport_remove_device(dev); |
701 | device_del(dev); | ||
699 | scsi_device_set_state(sdev, SDEV_DEL); | 702 | scsi_device_set_state(sdev, SDEV_DEL); |
700 | if (sdev->host->hostt->slave_destroy) | 703 | if (sdev->host->hostt->slave_destroy) |
701 | sdev->host->hostt->slave_destroy(sdev); | 704 | sdev->host->hostt->slave_destroy(sdev); |
702 | transport_unregister_device(&sdev->sdev_gendev); | 705 | transport_destroy_device(dev); |
703 | put_device(&sdev->sdev_gendev); | 706 | put_device(dev); |
704 | } | 707 | } |
705 | 708 | ||
706 | /** | 709 | /** |