All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Swen Schillig <swen@vnet.ibm.com>,
	Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 12/13] zfcp: Fix wka port processing
Date: Mon, 13 Jul 2009 15:06:13 +0200	[thread overview]
Message-ID: <20090713131044.264267000@de.ibm.com> (raw)
In-Reply-To: 20090713130601.304914000@de.ibm.com

[-- Attachment #1: 719-zfcp-racy-wka.diff --]
[-- Type: text/plain, Size: 1905 bytes --]

From: Swen Schillig <swen@vnet.ibm.com>

Under certain conditions it is possible that a WKA port ist not opened
within the expected timeframe of half a second. In this situation
the WKA port remains in the state OPENING preventing any succeding
request to open the port. This led to unrecoverable remote ports.
Fixing this by always setting an appropriate WKA port status before
leaving the function and removing the timeout value here since it's 
not needed here because the general timeout processing would deal
with it if required.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---

 drivers/s390/scsi/zfcp_fc.c  |    8 +++-----
 drivers/s390/scsi/zfcp_fsf.c |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

--- a/drivers/s390/scsi/zfcp_fc.c	2009-07-13 13:17:43.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fc.c	2009-07-13 13:18:20.000000000 +0200
@@ -79,11 +79,9 @@ static int zfcp_wka_port_get(struct zfcp
 
 	mutex_unlock(&wka_port->mutex);
 
-	wait_event_timeout(
-		wka_port->completion_wq,
-		wka_port->status == ZFCP_WKA_PORT_ONLINE ||
-		wka_port->status == ZFCP_WKA_PORT_OFFLINE,
-		HZ >> 1);
+	wait_event(wka_port->completion_wq,
+		   wka_port->status == ZFCP_WKA_PORT_ONLINE ||
+		   wka_port->status == ZFCP_WKA_PORT_OFFLINE);
 
 	if (wka_port->status == ZFCP_WKA_PORT_ONLINE) {
 		atomic_inc(&wka_port->refcount);
--- a/drivers/s390/scsi/zfcp_fsf.c	2009-07-13 13:18:10.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fsf.c	2009-07-13 13:18:20.000000000 +0200
@@ -1627,10 +1627,10 @@ static void zfcp_fsf_open_wka_port_handl
 	case FSF_ACCESS_DENIED:
 		wka_port->status = ZFCP_WKA_PORT_OFFLINE;
 		break;
-	case FSF_PORT_ALREADY_OPEN:
-		break;
 	case FSF_GOOD:
 		wka_port->handle = header->port_handle;
+		/* fall through */
+	case FSF_PORT_ALREADY_OPEN:
 		wka_port->status = ZFCP_WKA_PORT_ONLINE;
 	}
 out:

  parent reply	other threads:[~2009-07-13 13:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 13:06 [patch 00/13] zfcp fixes for 2.6.31-rc2 Christof Schmitt
2009-07-13 13:06 ` [patch 01/13] zfcp: Fix invalid command order Christof Schmitt
2009-07-13 13:06 ` [patch 02/13] zfcp: Acquire qdio_stat_lock when reading the queue utilization Christof Schmitt
2009-07-13 13:06 ` [patch 03/13] zfcp: Return -ENOMEM for allocation failures in zfcp_fsf Christof Schmitt
2009-07-13 13:06 ` [patch 04/13] zfcp: Use correct flags for zfcp_erp_notify Christof Schmitt
2009-07-13 13:06 ` [patch 05/13] zfcp: Use unchained mode for small ct and els requests Christof Schmitt
2009-07-13 13:06 ` [patch 06/13] zfcp: Use -EIO for SBAL allocation failures Christof Schmitt
2009-07-13 13:06 ` [patch 07/13] zfcp: Fix logic for physical port close Christof Schmitt
2009-07-13 13:06 ` [patch 08/13] zfcp: Fix erp escalation procedure Christof Schmitt
2009-07-13 13:06 ` [patch 09/13] zfcp: Recover from stalled outbound queue Christof Schmitt
2009-07-13 13:06 ` [patch 10/13] zfcp: Add port only once to FC transport class Christof Schmitt
2009-07-13 13:06 ` [patch 11/13] zfcp: avoid double notify in lowmem scenario Christof Schmitt
2009-07-13 13:06 ` Christof Schmitt [this message]
2009-07-13 13:06 ` [patch 13/13] zfcp: Fix tracing of request id for abort requests Christof Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090713131044.264267000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=swen@vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.