From: Matthew Wilcox Date: Wed, 15 Aug 2007 18:57:01 +0000 (-0600) Subject: [SCSI] ide-scsi: Close narrow race in release X-Git-Tag: v2.6.24-rc1~1290^2~72 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fdea8dbbe4fc021afb601ef5339d5c5825c5cb6;p=linux-2.6 [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: Matthew Wilcox Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 3b55a6c10b..d81bb076a1 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -671,6 +671,7 @@ static void ide_scsi_remove(ide_drive_t *drive) struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost); struct gendisk *g = scsi->disk; + scsi_remove_host(scsihost); ide_proc_unregister_driver(drive, scsi->driver); ide_unregister_region(g); @@ -679,7 +680,6 @@ static void ide_scsi_remove(ide_drive_t *drive) g->private_data = NULL; put_disk(g); - scsi_remove_host(scsihost); ide_scsi_put(scsi); }