From: Steffen Maier <maier@linux.vnet.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Steffen Maier <maier@linux.vnet.ibm.com>,
linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
stable@vger.kernel.org
Subject: [PATCH RESEND 9/9] zfcp: status read buffers on first adapter open with link down
Date: Fri, 26 Apr 2013 17:34:54 +0200 [thread overview]
Message-ID: <517A9E9E.6000108@linux.vnet.ibm.com> (raw)
In-Reply-To: <1366985635-38270-10-git-send-email-maier@linux.vnet.ibm.com>
Commit 64deb6efdc5504ce97b5c1c6f281fffbc150bd93
"[SCSI] zfcp: Use status_read_buf_num provided by FCP channel"
started using a value returned by the channel but only evaluated the value
if the fabric link is up.
Commit 8d88cf3f3b9af4713642caeb221b6d6a42019001
"[SCSI] zfcp: Update status read mempool"
introduced mempool resizings based on the above value.
On setting an FCP device online for the very first time since boot, a new
zeroed adapter object is allocated. If the link is down, the number of
status read requests remains zero. Since just the config data exchange is
incomplete, we proceed with adapter open recovery. However, we
unconditionally call mempool_resize with adapter->stat_read_buf_num == 0 in
this case.
This causes a kernel message "kernel BUG at mm/mempool.c:131!" in process
"zfcperp<FCP-device-bus-ID>" with last function mempool_resize in Krnl PSW
and zfcp_erp_thread in the Call Trace.
Don't evaluate channel values which are invalid on link down. The number of
status read requests is always valid, evaluated, and set to a positive
minimum greater than zero. The adapter open recovery can proceed and the
channel has status read buffers to inform us on a future link up event.
While we are not aware of any other code path that could result in mempool
resize attempts of size zero, we still also initialize the number of status
read buffers to be posted to a static minimum number on adapter object
allocation.
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.35+
---
drivers/s390/scsi/zfcp_aux.c | 5 ++++-
drivers/s390/scsi/zfcp_fsf.c | 23 ++++++++++++++++-------
2 files changed, 20 insertions(+), 8 deletions(-)
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -3,7 +3,7 @@
*
* Module interface and handling of zfcp data structures.
*
- * Copyright IBM Corp. 2002, 2010
+ * Copyright IBM Corp. 2002, 2013
*/
/*
@@ -23,6 +23,7 @@
* Christof Schmitt
* Martin Petermann
* Sven Schuetz
+ * Steffen Maier
*/
#define KMSG_COMPONENT "zfcp"
@@ -405,6 +406,8 @@ struct zfcp_adapter *zfcp_adapter_enqueu
adapter->dma_parms.max_segment_size = ZFCP_QDIO_SBALE_LEN;
adapter->ccw_device->dev.dma_parms = &adapter->dma_parms;
+ adapter->stat_read_buf_num = FSF_STATUS_READS_RECOM;
+
if (!zfcp_scsi_adapter_register(adapter))
return adapter;
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -3,7 +3,7 @@
*
* Implementation of FSF commands.
*
- * Copyright IBM Corp. 2002, 2010
+ * Copyright IBM Corp. 2002, 2013
*/
#define KMSG_COMPONENT "zfcp"
@@ -478,12 +478,8 @@ static int zfcp_fsf_exchange_config_eval
fc_host_port_name(shost) = nsp->fl_wwpn;
fc_host_node_name(shost) = nsp->fl_wwnn;
- fc_host_port_id(shost) = ntoh24(bottom->s_id);
- fc_host_speed(shost) =
- zfcp_fsf_convert_portspeed(bottom->fc_link_speed);
fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3;
- adapter->hydra_version = bottom->adapter_type;
adapter->timer_ticks = bottom->timer_interval & ZFCP_FSF_TIMER_INT_MASK;
adapter->stat_read_buf_num = max(bottom->status_read_buf_num,
(u16)FSF_STATUS_READS_RECOM);
@@ -491,6 +487,19 @@ static int zfcp_fsf_exchange_config_eval
if (fc_host_permanent_port_name(shost) == -1)
fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
+ zfcp_scsi_set_prot(adapter);
+
+ /* no error return above here, otherwise must fix call chains */
+ /* do not evaluate invalid fields */
+ if (req->qtcb->header.fsf_status == FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE)
+ return 0;
+
+ fc_host_port_id(shost) = ntoh24(bottom->s_id);
+ fc_host_speed(shost) =
+ zfcp_fsf_convert_portspeed(bottom->fc_link_speed);
+
+ adapter->hydra_version = bottom->adapter_type;
+
switch (bottom->fc_topology) {
case FSF_TOPO_P2P:
adapter->peer_d_id = ntoh24(bottom->peer_d_id);
@@ -512,8 +521,6 @@ static int zfcp_fsf_exchange_config_eval
return -EIO;
}
- zfcp_scsi_set_prot(adapter);
-
return 0;
}
@@ -564,6 +571,8 @@ static void zfcp_fsf_exchange_config_dat
&adapter->status);
zfcp_fsf_link_down_info_eval(req,
&qtcb->header.fsf_status_qual.link_down_info);
+ if (zfcp_fsf_exchange_config_evaluate(req))
+ return;
break;
default:
zfcp_erp_adapter_shutdown(adapter, 0, "fsecdh3");
prev parent reply other threads:[~2013-04-26 15:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 14:13 [PATCH RESEND 0/9] zfcp features and bugfixes for 3.10 merge window Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 1/9] zfcp: cfdc fops add owner Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 2/9] zfcp: cleanup port sysfs attribute usage Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 3/9] zfcp: cleanup unit " Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 4/9] zfcp: remove unused device_unregister wrapper Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 7/9] zfcp: module parameter dbflevel for early debugging Steffen Maier
2013-04-26 14:13 ` [PATCH RESEND 8/9] zfcp: remove access control tables interface Steffen Maier
2013-04-26 15:10 ` [PATCH RESEND 0/9] zfcp features and bugfixes for 3.10 merge window James Bottomley
2013-04-26 15:44 ` Steffen Maier
2013-04-26 16:10 ` James Bottomley
2013-04-27 9:44 ` Heiko Carstens
[not found] ` <1366985635-38270-6-git-send-email-maier@linux.vnet.ibm.com>
2013-04-26 15:32 ` [PATCH RESEND 5/9] zfcp: fix adapter (re)open recovery while link to SAN is down Steffen Maier
[not found] ` <1366985635-38270-7-git-send-email-maier@linux.vnet.ibm.com>
2013-04-26 15:33 ` [PATCH RESEND 6/9] zfcp: block queue limits with data router Steffen Maier
[not found] ` <1366985635-38270-10-git-send-email-maier@linux.vnet.ibm.com>
2013-04-26 15:34 ` Steffen Maier [this message]
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=517A9E9E.6000108@linux.vnet.ibm.com \
--to=maier@linux.vnet.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=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).