diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-11-26 12:07:36 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-01 11:16:59 -0500 |
commit | 1c1cba17a9078c83a80a099bc207b208d664a13a (patch) | |
tree | 2b49370fa8b20d488f3d7492d20981acb3db149a /drivers/s390 | |
parent | bce02614cd1b3d669af1195695e503e818b60fae (diff) |
[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: Christof Schmitt <christof.schmitt@de.ibm.com>
Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index c5f4bd217bfe..ae151390cb9f 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -50,7 +50,8 @@ static int zfcp_wka_port_get(struct zfcp_wka_port *wka_port) | |||
50 | if (mutex_lock_interruptible(&wka_port->mutex)) | 50 | if (mutex_lock_interruptible(&wka_port->mutex)) |
51 | return -ERESTARTSYS; | 51 | return -ERESTARTSYS; |
52 | 52 | ||
53 | if (wka_port->status != ZFCP_WKA_PORT_ONLINE) { | 53 | if (wka_port->status == ZFCP_WKA_PORT_OFFLINE || |
54 | wka_port->status == ZFCP_WKA_PORT_CLOSING) { | ||
54 | wka_port->status = ZFCP_WKA_PORT_OPENING; | 55 | wka_port->status = ZFCP_WKA_PORT_OPENING; |
55 | if (zfcp_fsf_open_wka_port(wka_port)) | 56 | if (zfcp_fsf_open_wka_port(wka_port)) |
56 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; | 57 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index d024442ee128..48bfd3049244 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -1584,6 +1584,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req) | |||
1584 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; | 1584 | wka_port->status = ZFCP_WKA_PORT_OFFLINE; |
1585 | break; | 1585 | break; |
1586 | case FSF_PORT_ALREADY_OPEN: | 1586 | case FSF_PORT_ALREADY_OPEN: |
1587 | break; | ||
1587 | case FSF_GOOD: | 1588 | case FSF_GOOD: |
1588 | wka_port->handle = header->port_handle; | 1589 | wka_port->handle = header->port_handle; |
1589 | wka_port->status = ZFCP_WKA_PORT_ONLINE; | 1590 | wka_port->status = ZFCP_WKA_PORT_ONLINE; |