aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/hosts.c
diff options
context:
space:
mode:
authorMike Anderson <andmike@us.ibm.com>2005-06-16 11:14:33 -0700
committerJames Bottomley <jejb@mulgrave.(none)>2005-07-30 11:13:01 -0500
commit82f29467a025f6a2192d281e97fca0be46e905cc (patch)
tree5cf356ece53caf2936ca85803676b326094f7c38 /drivers/scsi/hosts.c
parentd2c9d9eafa03dbd08a8a439e6c5addb8b1f03b9b (diff)
[SCSI] host state model update: mediate host add/remove race
Add support to not allow additions to a host when it is being removed. Signed-off-by: Mike Anderson <andmike@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r--drivers/scsi/hosts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 67c4c0c3aa5..8640ad1c17e 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -133,7 +133,9 @@ EXPORT_SYMBOL(scsi_host_set_state);
**/
void scsi_remove_host(struct Scsi_Host *shost)
{
+ down(&shost->scan_mutex);
scsi_host_set_state(shost, SHOST_CANCEL);
+ up(&shost->scan_mutex);
scsi_forget_host(shost);
scsi_proc_host_rm(shost);