• J
    [SCSI] dual scan thread bug fix · f2495e22
    James Bottomley 提交于
    In the highly unusual case where two threads are running concurrently through
    the scanning code scanning the same target, we run into the situation where
    one may allocate the target while the other is still using it.  In this case,
    because the reap checks for STARGET_CREATED and kills the target without
    reference counting, the second thread will do the wrong thing on reap.
    
    Fix this by reference counting even creates and doing the STARGET_CREATED
    check in the final put.
    Tested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
    Cc: stable@vger.kernel.org # delay backport for 2 months for field testing
    Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
    f2495e22
scsi_scan.c 56.0 KB