Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df133c21 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley
Browse files

[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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f912696a
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -691,16 +691,19 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)


void __scsi_remove_device(struct scsi_device *sdev)
void __scsi_remove_device(struct scsi_device *sdev)
{
{
	struct device *dev = &sdev->sdev_gendev;

	if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
	if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
		return;
		return;


	class_device_unregister(&sdev->sdev_classdev);
	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);
	scsi_device_set_state(sdev, SDEV_DEL);
	if (sdev->host->hostt->slave_destroy)
	if (sdev->host->hostt->slave_destroy)
		sdev->host->hostt->slave_destroy(sdev);
		sdev->host->hostt->slave_destroy(sdev);
	transport_unregister_device(&sdev->sdev_gendev);
	transport_destroy_device(dev);
	put_device(&sdev->sdev_gendev);
	put_device(dev);
}
}


/**
/**