[SCSI] sym53c8xx_2: slave_alloc/destroy safety (2.6.27.5)
authorAaro Koskinen <Aaro.Koskinen@nokia.com>
Tue, 14 Apr 2009 20:47:00 +0000 (15:47 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Wed, 20 May 2009 22:21:14 +0000 (17:21 -0500)
commitfa8584566cc9cdaf067dbc12132792887a521da9
treee103d0c9b1885ad8c017ea5f20b7881f06e85239
parent410604d25faddb1b4f0f9667b7452c06cc06cea1
[SCSI] sym53c8xx_2: slave_alloc/destroy safety (2.6.27.5)

Make the sym53c8xx_2 driver slave_alloc/destroy less unsafe. References
to the destroyed LCB are cleared from the target structure (instead of
leaving a dangling pointer), and when the last LCB for the target is
destroyed the reference to the upper layer target data is cleared. The
host lock is used to prevent a race with the interrupt handler. Also
user commands are prevented for targets with all LCBs destroyed.

Signed-off-by: Aaro Koskinen <Aaro.Koskinen@nokia.com>
Tested-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/sym53c8xx_2/sym_hipd.c
drivers/scsi/sym53c8xx_2/sym_hipd.h