]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] SCSI scanning and removal fixes
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 26 Jul 2005 14:27:10 +0000 (10:27 -0400)
committerJames Bottomley <jejb@titanic.(none)>
Sun, 18 Sep 2005 20:22:06 +0000 (15:22 -0500)
commit59e2e2f7a993937324397a1eb10d9d75afd15653
treee222f3f17d6962a84d966620485d19f67d7fafa7
parent28f62d5281ceecfa67ea7076e07c64eb9287ef3a
[SCSI] SCSI scanning and removal fixes

This patch (as545) fixes the list traversals in __scsi_remove_target and
scsi_forget_host.  In each case the existing code list_for_each_entry_safe
in an _unsafe_ manner, because the list was not protected from outside
modification while the iteration was running.

The new scsi_forget_host routine takes the moderately controversial step
of iterating over devices for removal rather than iterating over targets.
This makes more sense to me because the current scheme treats targets as
second-class citizens, created and removed on demand, rather than as
objects corresponding to actual hardware.  (Also I couldn't figure out any
safe way to iterate over the target list, since it's not so easy to tell
when a target has already been removed.)

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_sysfs.c