Commit 24095490 authored by Swen Schillig's avatar Swen Schillig Committed by James Bottomley

[SCSI] zfcp: incorrect reaction on incoming RSCN

After an error condition resolved a remote storage port was never
re-opened. The incoming RSCN was not processed accordingly due
to a misinterpreted status flag / return value combination.
Signed-off-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 21ddaa53
...@@ -145,16 +145,10 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, ...@@ -145,16 +145,10 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
struct zfcp_port *port; struct zfcp_port *port;
read_lock_irqsave(&zfcp_data.config_lock, flags); read_lock_irqsave(&zfcp_data.config_lock, flags);
list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { list_for_each_entry(port, &fsf_req->adapter->port_list_head, list)
if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_PHYS_OPEN)) if ((port->d_id & range) == (elem->nport_did & range))
/* Try to connect to unused ports anyway. */
zfcp_erp_port_reopen(port,
ZFCP_STATUS_COMMON_ERP_FAILED,
"fcirsc1", fsf_req);
else if ((port->d_id & range) == (elem->nport_did & range))
/* Check connection status for connected ports */
zfcp_test_link(port); zfcp_test_link(port);
}
read_unlock_irqrestore(&zfcp_data.config_lock, flags); read_unlock_irqrestore(&zfcp_data.config_lock, flags);
} }
...@@ -381,8 +375,10 @@ static void zfcp_fc_adisc_handler(unsigned long data) ...@@ -381,8 +375,10 @@ static void zfcp_fc_adisc_handler(unsigned long data)
if (!port->wwnn) if (!port->wwnn)
port->wwnn = ls_adisc->wwnn; port->wwnn = ls_adisc->wwnn;
if (port->wwpn != ls_adisc->wwpn) if ((port->wwpn != ls_adisc->wwpn) ||
zfcp_erp_port_reopen(port, 0, "fcadh_2", NULL); !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN))
zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED,
"fcadh_2", NULL);
out: out:
zfcp_port_put(port); zfcp_port_put(port);
......
...@@ -1161,10 +1161,6 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) ...@@ -1161,10 +1161,6 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els)
struct fsf_qtcb_bottom_support *bottom; struct fsf_qtcb_bottom_support *bottom;
int ret = -EIO; int ret = -EIO;
if (unlikely(!(atomic_read(&els->port->status) &
ZFCP_STATUS_COMMON_UNBLOCKED)))
return -EBUSY;
spin_lock_bh(&adapter->req_q_lock); spin_lock_bh(&adapter->req_q_lock);
if (zfcp_fsf_req_sbal_get(adapter)) if (zfcp_fsf_req_sbal_get(adapter))
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment