From 059c97d0434834d291eff94669ca2dd3eaac9d28 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Tue, 13 Sep 2005 21:47:52 +0200 Subject: [SCSI] zfcp: remove union zfcp_req_data, use unit refcount for FCP commands o union zfcp_req_data removed o increment unit refcount when processing FCP commands (This fixes a theoretical race: When all scsi commands of a unit are aborted and the scsi_device is removed then the unit could be removed before all fsf_requests of that unit are completely processed.) Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/s390/scsi/zfcp_aux.c') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index bfe3ba7..17f9989 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -141,7 +141,7 @@ zfcp_cmd_dbf_event_fsf(const char *text, struct zfcp_fsf_req *fsf_req, spin_lock_irqsave(&adapter->dbf_lock, flags); if (zfcp_fsf_req_is_scsi_cmnd(fsf_req)) { - scsi_cmnd = fsf_req->data.send_fcp_command_task.scsi_cmnd; + scsi_cmnd = (struct scsi_cmnd*) fsf_req->data; debug_text_event(adapter->cmd_dbf, level, "fsferror"); debug_text_event(adapter->cmd_dbf, level, text); debug_event(adapter->cmd_dbf, level, &fsf_req, @@ -167,14 +167,12 @@ void zfcp_cmd_dbf_event_scsi(const char *text, struct scsi_cmnd *scsi_cmnd) { struct zfcp_adapter *adapter; - union zfcp_req_data *req_data; struct zfcp_fsf_req *fsf_req; int level = ((host_byte(scsi_cmnd->result) != 0) ? 1 : 5); unsigned long flags; adapter = (struct zfcp_adapter *) scsi_cmnd->device->host->hostdata[0]; - req_data = (union zfcp_req_data *) scsi_cmnd->host_scribble; - fsf_req = (req_data ? req_data->send_fcp_command_task.fsf_req : NULL); + fsf_req = (struct zfcp_fsf_req *) scsi_cmnd->host_scribble; spin_lock_irqsave(&adapter->dbf_lock, flags); debug_text_event(adapter->cmd_dbf, level, "hostbyte"); debug_text_event(adapter->cmd_dbf, level, text); @@ -1609,7 +1607,7 @@ zfcp_fsf_incoming_els(struct zfcp_fsf_req *fsf_req) u32 els_type; struct zfcp_adapter *adapter; - status_buffer = fsf_req->data.status_read.buffer; + status_buffer = (struct fsf_status_read_buffer *) fsf_req->data; els_type = *(u32 *) (status_buffer->payload); adapter = fsf_req->adapter; -- cgit v1.1