Commit 1c1cba17 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Fix opening of wka ports

Running two wka_port_get calls in parallel could issue two open_port
requests, overwriting the port handle. Don't issue an open_port
for the state PORT_OPENING, and only read the data from GOOD
responses.
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Acked-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent bce02614
...@@ -50,7 +50,8 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port) ...@@ -50,7 +50,8 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port)
if (mutex_lock_interruptible(&wka_port->mutex)) if (mutex_lock_interruptible(&wka_port->mutex))
return -ERESTARTSYS; return -ERESTARTSYS;
if (wka_port->status != ZFCP_WKA_PORT_ONLINE) { if (wka_port->status == ZFCP_WKA_PORT_OFFLINE ||
wka_port->status == ZFCP_WKA_PORT_CLOSING) {
wka_port->status = ZFCP_WKA_PORT_OPENING; wka_port->status = ZFCP_WKA_PORT_OPENING;
if (zfcp_fsf_open_wka_port(wka_port)) if (zfcp_fsf_open_wka_port(wka_port))
wka_port->status = ZFCP_WKA_PORT_OFFLINE; wka_port->status = ZFCP_WKA_PORT_OFFLINE;
......
...@@ -1584,6 +1584,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) ...@@ -1584,6 +1584,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
wka_port->status = ZFCP_WKA_PORT_OFFLINE; wka_port->status = ZFCP_WKA_PORT_OFFLINE;
break; break;
case FSF_PORT_ALREADY_OPEN: case FSF_PORT_ALREADY_OPEN:
break;
case FSF_GOOD: case FSF_GOOD:
wka_port->handle = header->port_handle; wka_port->handle = header->port_handle;
wka_port->status = ZFCP_WKA_PORT_ONLINE; wka_port->status = ZFCP_WKA_PORT_ONLINE;
......
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