• Andi Kleen's avatar
    [PATCH] Fix selection of command serial numbers and pids · e59d89da
    Andi Kleen authored
    This patch fixes one of Christroph's fixme comments in the SCSI midlayer.
    
    The selection of the serial number and pid for commands was done
    by a global variable and not SMP safe. The race was not very
    serious because it was only used for error handling, but it's
    still better to fix it.
    
    I audited all the drivers and none seemed to use them
    for anything interesting, so I just made it a per host counter
    protected by host lock.
    
    (in fact they could be probably removed because they only see
    to be used as a flag in exception handling and for debugging.
    The patch would be unfortunately quite big because a lot
    of driver printks use them)
    
    This should be slight faster on SMP too because the cache line of
    the counter won't bounce around the machine.
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
    e59d89da
scsi_cmnd.h 5.46 KB