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,
Martin Petermann <martin.petermann@de.ibm.com>,
Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 6/9] zfcp: Increase ref counter for port open requests
Date: Fri, 15 May 2009 13:18:19 +0200 [thread overview]
Message-ID: <20090515112222.042636000@de.ibm.com> (raw)
In-Reply-To: 20090515111813.314177000@de.ibm.com
[-- Attachment #1: 705-zfcp-refcount-portopen.diff --]
[-- Type: text/plain, Size: 1976 bytes --]
From: Martin Petermann <martin.petermann@de.ibm.com>
In rare cases, open port request might timeout, erp calls
zfcp_port_put, port gets dequeued. Now, the late returning (or
dismissed) fsf-port-open calls the fsf_port_open_handler that tries to
reference the port data structure leading to a kernel oops.
Signed-off-by: Martin Petermann <martin.petermann@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
drivers/s390/scsi/zfcp_fsf.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
--- a/drivers/s390/scsi/zfcp_fsf.c 2009-05-15 12:56:17.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fsf.c 2009-05-15 12:56:19.000000000 +0200
@@ -1402,7 +1402,7 @@ static void zfcp_fsf_open_port_handler(s
struct fsf_plogi *plogi;
if (req->status & ZFCP_STATUS_FSFREQ_ERROR)
- return;
+ goto out;
switch (header->fsf_status) {
case FSF_PORT_ALREADY_OPEN:
@@ -1464,6 +1464,9 @@ static void zfcp_fsf_open_port_handler(s
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
break;
}
+
+out:
+ zfcp_port_put(port);
}
/**
@@ -1476,6 +1479,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_a
struct qdio_buffer_element *sbale;
struct zfcp_adapter *adapter = erp_action->adapter;
struct zfcp_fsf_req *req;
+ struct zfcp_port *port = erp_action->port;
int retval = -EIO;
spin_lock_bh(&adapter->req_q_lock);
@@ -1496,16 +1500,18 @@ int zfcp_fsf_open_port(struct zfcp_erp_a
sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
req->handler = zfcp_fsf_open_port_handler;
- req->qtcb->bottom.support.d_id = erp_action->port->d_id;
- req->data = erp_action->port;
+ req->qtcb->bottom.support.d_id = port->d_id;
+ req->data = port;
req->erp_action = erp_action;
erp_action->fsf_req = req;
+ zfcp_port_get(port);
zfcp_fsf_start_erp_timer(req);
retval = zfcp_fsf_req_send(req);
if (retval) {
zfcp_fsf_req_free(req);
erp_action->fsf_req = NULL;
+ zfcp_port_put(port);
}
out:
spin_unlock_bh(&adapter->req_q_lock);
next prev parent reply other threads:[~2009-05-15 11:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-15 11:18 [patch 0/9] zfcp updates for 2.6.31 Christof Schmitt
2009-05-15 11:18 ` [patch 1/9] zfcp: Use correct req_id for traces Christof Schmitt
2009-05-15 11:18 ` [patch 2/9] zfcp: Update message and add description Christof Schmitt
2009-05-15 11:18 ` [patch 3/9] zfcp: Make queue_depth adjustable Christof Schmitt
2009-05-15 11:18 ` [patch 4/9] zfcp: Remove unnecessary default case and assignments Christof Schmitt
2009-05-15 11:18 ` [patch 5/9] zfcp: Add comments to switch/case fallthroughs Christof Schmitt
2009-05-15 11:18 ` Christof Schmitt [this message]
2009-05-15 11:18 ` [patch 7/9] zfcp: Changed D_ID left port disabled Christof Schmitt
2009-05-15 11:18 ` [patch 8/9] zfcp: Keep ccw device and model id in zfcp_ccw.c Christof Schmitt
2009-05-15 11:18 ` [patch 9/9] zfcp: Update FC pass-through support 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=20090515112222.042636000@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=martin.petermann@de.ibm.com \
--cc=schwidefsky@de.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.