diff options
author | Aaro Koskinen <Aaro.Koskinen@nokia.com> | 2009-04-14 16:47:00 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:14 -0400 |
commit | fa8584566cc9cdaf067dbc12132792887a521da9 (patch) | |
tree | e103d0c9b1885ad8c017ea5f20b7881f06e85239 /drivers/scsi/sym53c8xx_2/sym_hipd.h | |
parent | 410604d25faddb1b4f0f9667b7452c06cc06cea1 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/sym53c8xx_2/sym_hipd.h')
-rw-r--r-- | drivers/scsi/sym53c8xx_2/sym_hipd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h index 9ebc8706b6bf..053e63c86822 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.h +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h | |||
@@ -401,6 +401,7 @@ struct sym_tcb { | |||
401 | * An array of bus addresses is used on reselection. | 401 | * An array of bus addresses is used on reselection. |
402 | */ | 402 | */ |
403 | u32 *luntbl; /* LCBs bus address table */ | 403 | u32 *luntbl; /* LCBs bus address table */ |
404 | int nlcb; /* Number of valid LCBs (including LUN #0) */ | ||
404 | 405 | ||
405 | /* | 406 | /* |
406 | * LUN table used by the C code. | 407 | * LUN table used by the C code. |
@@ -1065,6 +1066,7 @@ int sym_clear_tasks(struct sym_hcb *np, int cam_status, int target, int lun, int | |||
1065 | struct sym_ccb *sym_get_ccb(struct sym_hcb *np, struct scsi_cmnd *cmd, u_char tag_order); | 1066 | struct sym_ccb *sym_get_ccb(struct sym_hcb *np, struct scsi_cmnd *cmd, u_char tag_order); |
1066 | void sym_free_ccb(struct sym_hcb *np, struct sym_ccb *cp); | 1067 | void sym_free_ccb(struct sym_hcb *np, struct sym_ccb *cp); |
1067 | struct sym_lcb *sym_alloc_lcb(struct sym_hcb *np, u_char tn, u_char ln); | 1068 | struct sym_lcb *sym_alloc_lcb(struct sym_hcb *np, u_char tn, u_char ln); |
1069 | int sym_free_lcb(struct sym_hcb *np, u_char tn, u_char ln); | ||
1068 | int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *csio, struct sym_ccb *cp); | 1070 | int sym_queue_scsiio(struct sym_hcb *np, struct scsi_cmnd *csio, struct sym_ccb *cp); |
1069 | int sym_abort_scsiio(struct sym_hcb *np, struct scsi_cmnd *ccb, int timed_out); | 1071 | int sym_abort_scsiio(struct sym_hcb *np, struct scsi_cmnd *ccb, int timed_out); |
1070 | int sym_reset_scsi_target(struct sym_hcb *np, int target); | 1072 | int sym_reset_scsi_target(struct sym_hcb *np, int target); |