Commit 6fdea8db authored by Matthew Wilcox's avatar Matthew Wilcox Committed by James Bottomley

[SCSI] ide-scsi: Close narrow race in release

We were releasing the block devices before removing the host, so commands
could still be coming in which would cause a panic.  Just remove the
host before releasing the block devices to close this race.
Signed-off-by: default avatarMatthew Wilcox <matthew@wil.cx>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 34f8f0d2
...@@ -671,6 +671,7 @@ static void ide_scsi_remove(ide_drive_t *drive) ...@@ -671,6 +671,7 @@ static void ide_scsi_remove(ide_drive_t *drive)
struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost); struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost);
struct gendisk *g = scsi->disk; struct gendisk *g = scsi->disk;
scsi_remove_host(scsihost);
ide_proc_unregister_driver(drive, scsi->driver); ide_proc_unregister_driver(drive, scsi->driver);
ide_unregister_region(g); ide_unregister_region(g);
...@@ -679,7 +680,6 @@ static void ide_scsi_remove(ide_drive_t *drive) ...@@ -679,7 +680,6 @@ static void ide_scsi_remove(ide_drive_t *drive)
g->private_data = NULL; g->private_data = NULL;
put_disk(g); put_disk(g);
scsi_remove_host(scsihost);
ide_scsi_put(scsi); ide_scsi_put(scsi);
} }
......
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