aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2005-06-13 07:18:56 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-06-13 22:30:05 -0400
commit64b29a130901d5b8578e9f602cf2dae56aaff224 (patch)
treefb543d8a7c007416d99128246d4e71580ecd94ff /drivers/s390/scsi/zfcp_fsf.c
parent516a4201bacfd61ea957039d6f47276ee9c32a0d (diff)
[SCSI] zfcp: fix: problem in send_els_handler when D_ID assignment changes
From: Maxim Shchetynin <maxim@de.ibm.com> Fixes a bug in zfcp_send_els_handler. If D_ID assignments for ports are changing between initiation of one ELS request and its completion the wrong port might be accessed in the completion for that ELS request. Thus a pointer to the port has to be passed for ELS requests to identify the port structure if required. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index bf66fc6d8a97..21a6d7633475 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1771,8 +1771,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1771static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) 1771static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1772{ 1772{
1773 struct zfcp_adapter *adapter; 1773 struct zfcp_adapter *adapter;
1774 fc_id_t d_id;
1775 struct zfcp_port *port; 1774 struct zfcp_port *port;
1775 fc_id_t d_id;
1776 struct fsf_qtcb_header *header; 1776 struct fsf_qtcb_header *header;
1777 struct fsf_qtcb_bottom_support *bottom; 1777 struct fsf_qtcb_bottom_support *bottom;
1778 struct zfcp_send_els *send_els; 1778 struct zfcp_send_els *send_els;
@@ -1781,6 +1781,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1781 1781
1782 send_els = fsf_req->data.send_els; 1782 send_els = fsf_req->data.send_els;
1783 adapter = send_els->adapter; 1783 adapter = send_els->adapter;
1784 port = send_els->port;
1784 d_id = send_els->d_id; 1785 d_id = send_els->d_id;
1785 header = &fsf_req->qtcb->header; 1786 header = &fsf_req->qtcb->header;
1786 bottom = &fsf_req->qtcb->bottom.support; 1787 bottom = &fsf_req->qtcb->bottom.support;
@@ -1817,13 +1818,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1817 switch (header->fsf_status_qual.word[0]){ 1818 switch (header->fsf_status_qual.word[0]){
1818 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1819 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1819 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); 1820 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");
1820 if (send_els->ls_code != ZFCP_LS_ADISC) { 1821 if (port && (send_els->ls_code != ZFCP_LS_ADISC))
1821 read_lock(&zfcp_data.config_lock); 1822 zfcp_test_link(port);
1822 port = zfcp_get_port_by_did(adapter, d_id);
1823 if (port)
1824 zfcp_test_link(port);
1825 read_unlock(&zfcp_data.config_lock);
1826 }
1827 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1823 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1828 break; 1824 break;
1829 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1825 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -1913,11 +1909,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1913 } 1909 }
1914 } 1910 }
1915 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); 1911 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access");
1916 read_lock(&zfcp_data.config_lock);
1917 port = zfcp_get_port_by_did(adapter, d_id);
1918 if (port != NULL) 1912 if (port != NULL)
1919 zfcp_erp_port_access_denied(port); 1913 zfcp_erp_port_access_denied(port);
1920 read_unlock(&zfcp_data.config_lock);
1921 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1914 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1922 break; 1915 break;
1923 1916