From: frank.blaschka@de.ibm.com
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Ursula Braun <ursula.braun@de.ibm.com>
Subject: [patch 3/4] qeth: avoid crash in case of layer mismatch for VSWITCH
Date: Thu, 11 Dec 2008 14:23:12 +0100 [thread overview]
Message-ID: <20081211132419.882781000@de.ibm.com> (raw)
In-Reply-To: 20081211132309.053505000@de.ibm.com
[-- Attachment #1: 605-qeth-layercrash.diff --]
[-- Type: text/plain, Size: 2641 bytes --]
From: Ursula Braun <ursula.braun@de.ibm.com>
For z/VM GuestLAN or VSWITCH devices the transport layer is
configured in z/VM. The layer2 attribute of a participating Linux
device has to match the z/VM definition. In case of a mismatch
Linux currently crashes in qeth recovery due to a reference to the
not yet existing net_device.
Solution: add a check for existence of net_device and add a message
pointing to the mismatch of layer definitions in Linux and z/VM.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
drivers/s390/net/qeth_core_main.c | 4 ++++
drivers/s390/net/qeth_l2_main.c | 8 +++++---
drivers/s390/net/qeth_l3_main.c | 8 +++++---
3 files changed, 14 insertions(+), 6 deletions(-)
Index: git_linux-next/drivers/s390/net/qeth_core_main.c
===================================================================
--- git_linux-next.orig/drivers/s390/net/qeth_core_main.c
+++ git_linux-next/drivers/s390/net/qeth_core_main.c
@@ -572,6 +572,10 @@ static void qeth_send_control_data_cb(st
card = CARD_FROM_CDEV(channel->ccwdev);
if (qeth_check_idx_response(iob->data)) {
qeth_clear_ipacmd_list(card);
+ if (((iob->data[2] & 0xc0) == 0xc0) && iob->data[4] == 0xf6)
+ dev_err(&card->gdev->dev,
+ "The qeth device is not configured "
+ "for the OSI layer required by z/VM\n");
qeth_schedule_recovery(card);
goto out;
}
Index: git_linux-next/drivers/s390/net/qeth_l2_main.c
===================================================================
--- git_linux-next.orig/drivers/s390/net/qeth_l2_main.c
+++ git_linux-next/drivers/s390/net/qeth_l2_main.c
@@ -1126,9 +1126,11 @@ static int qeth_l2_recover(void *ptr)
dev_info(&card->gdev->dev,
"Device successfully recovered!\n");
else {
- rtnl_lock();
- dev_close(card->dev);
- rtnl_unlock();
+ if (card->dev) {
+ rtnl_lock();
+ dev_close(card->dev);
+ rtnl_unlock();
+ }
dev_warn(&card->gdev->dev, "The qeth device driver "
"failed to recover an error on the device\n");
}
Index: git_linux-next/drivers/s390/net/qeth_l3_main.c
===================================================================
--- git_linux-next.orig/drivers/s390/net/qeth_l3_main.c
+++ git_linux-next/drivers/s390/net/qeth_l3_main.c
@@ -2082,9 +2082,11 @@ static int qeth_l3_stop_card(struct qeth
if (recovery_mode)
qeth_l3_stop(card->dev);
else {
- rtnl_lock();
- dev_close(card->dev);
- rtnl_unlock();
+ if (card->dev) {
+ rtnl_lock();
+ dev_close(card->dev);
+ rtnl_unlock();
+ }
}
if (!card->use_hard_stop) {
rc = qeth_send_stoplan(card);
--
next prev parent reply other threads:[~2008-12-11 13:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 13:23 [patch 0/4] s390: qeth fixes 2.6.29 frank.blaschka
2008-12-11 13:23 ` [patch 1/4] qeth: HiperSockets mcl string conversion (pre z9 mach) frank.blaschka
2008-12-11 13:23 ` [patch 2/4] qeth: exploit source MAC address for inbound layer3 packets frank.blaschka
2008-12-11 13:23 ` frank.blaschka [this message]
2008-12-11 13:23 ` [patch 4/4] qeth: do not spin for SETIP ip assist command frank.blaschka
2008-12-15 8:46 ` [patch 0/4] s390: qeth fixes 2.6.29 David Miller
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=20081211132419.882781000@de.ibm.com \
--to=frank.blaschka@de.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ursula.braun@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox