Commit b0fbe7b6 authored by Matthew Dharm's avatar Matthew Dharm Committed by Linus Torvalds

[PATCH] problems with USB memory pen

This fixes a bug which was introduced when the code was switched to use
atomic_read()s.

The bug prevents hot-unplugging of SCSI (or emulated SCSI) devices from
working. 

From Patrick Mansfield.
parent 52c4e575
...@@ -412,7 +412,7 @@ void scsi_remove_device(struct scsi_device *sdev) ...@@ -412,7 +412,7 @@ void scsi_remove_device(struct scsi_device *sdev)
set_bit(SDEV_DEL, &sdev->sdev_state); set_bit(SDEV_DEL, &sdev->sdev_state);
if (sdev->host->hostt->slave_destroy) if (sdev->host->hostt->slave_destroy)
sdev->host->hostt->slave_destroy(sdev); sdev->host->hostt->slave_destroy(sdev);
if (atomic_read(&sdev->access_count)) if (!atomic_read(&sdev->access_count))
device_del(&sdev->sdev_gendev); device_del(&sdev->sdev_gendev);
up_write(&class->subsys.rwsem); up_write(&class->subsys.rwsem);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment