Skip to content
  • Alan Stern's avatar
    [SCSI] SCSI scanning and removal fixes · a64358db
    Alan Stern authored
    
    
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    a64358db