From: Chris Lalancette <clalance@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH]: Unregister inetdev notifiers on failure
Date: Fri, 27 Feb 2009 18:26:59 +0100 [thread overview]
Message-ID: <49A82263.9050707@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
(Kier, I'm not sure if you are still accepting patches for the
linux-2.6.18-xen.hg tree, but if so...)
If you attempt to modprobe the pv-on-hvm netfront driver on a machine not
running under Xen (say, bare-metal, or under another hypervisor), the netfront
code correctly returns an ENODEV and fails to load. However, if you then
shutdown that machine, you will oops while tearing down the network. This is
because we forget to unregister the the inetaddr_notifier on failure, and so the
kernel takes a fatal page fault. The attached patch just unregisters the
notifier on failure, and solves the problem for me.
Signed-off-by: Chris Lalancette <clalance@redhat.com>
[-- Attachment #2: xen-unregister-netfront-notifiers.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]
diff --git a/drivers/xen/netfront/netfront.c b/drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c
+++ b/drivers/xen/netfront/netfront.c
@@ -2199,6 +2199,8 @@ static struct xenbus_driver netfront_dri
static int __init netif_init(void)
{
+ int err;
+
if (!is_running_on_xen())
return -ENODEV;
@@ -2220,7 +2222,13 @@ static int __init netif_init(void)
(void)register_inetaddr_notifier(¬ifier_inetdev);
#endif
- return xenbus_register_frontend(&netfront_driver);
+ err = xenbus_register_frontend(&netfront_driver);
+ if (err) {
+#ifdef CONFIG_INET
+ unregister_inetaddr_notifier(¬ifier_inetdev);
+#endif
+ }
+ return err;
}
module_init(netif_init);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2009-02-27 17:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=49A82263.9050707@redhat.com \
--to=clalance@redhat.com \
--cc=xen-devel@lists.xensource.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.