• Mike Anderson's avatar
    [PATCH] reorder call in scsi_remove_host · 44d90463
    Mike Anderson authored
    This patch against scsi-misc-2.6 reorders a call to scsi_forget_host in
    the scsi_remove_host function. This removes the error message
    "Synchronizing SCSI cache..." on rmmod of a scsi host driver module as
    shown in example output 1 and 2 below.
    
    I had previous created a much more complicated patch to work around this
    problem. In response Christoph mention a simpler solution (pointer to
    thread below) which is this patch.
    
    http://marc.theaimsgroup.com/?l=linux-scsi&m=108720042210331&w=2
    
    Example output.
    
    1.) Before patch.
    
    elm:~# scsi1 : scsi_debug, version 1.73 [20040518], dev_size_mb=8,
    opts=0x0
      Vendor: Linux     Model: scsi_debug        Rev: 0004
      Type:   Direct-Access                      ANSI SCSI revision: 03
    SCSI device sdc: 16384 512-byte hdwr sectors (8 MB)
    SCSI device sdc: drive cache: write back
     sdc: unknown partition table
    Attached scsi disk sdc at scsi1, channel 0, id 0, lun 0
    Attached scsi generic sg4 at scsi1, channel 0, id 0, lun 0,  type 0
    Synchronizing SCSI cache for disk sdc: <4>FAILED
      status = 0, message = 00, host = 1, driver = 00
    
    2.) After patch.
    
    elm:~# scsi1 : scsi_debug, version 1.73 [20040518], dev_size_mb=8, opts=0x0
      Vendor: Linux     Model: scsi_debug        Rev: 0004
      Type:   Direct-Access                      ANSI SCSI revision: 03
    SCSI device sdc: 16384 512-byte hdwr sectors (8 MB)
    SCSI device sdc: drive cache: write back
     sdc: unknown partition table
    Attached scsi disk sdc at scsi1, channel 0, id 0, lun 0
    Attached scsi generic sg4 at scsi1, channel 0, id 0, lun 0,  type 0
    Synchronizing SCSI cache for disk sdc:
    Signed-off-by: default avatarMike Anderson <andmike@us.ibm.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    44d90463
hosts.c 9.41 KB