This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [linux-2.6.18-xen] netfront: Unregister inetdev notifier

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: Unregister inetdev notifiers on failure
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 02 Mar 2009 12:05:09 -0800
Delivery-date: Mon, 02 Mar 2009 12:05:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1235992012 0
# Node ID 86e119bc82c5137e502bc8f68f65aba37f0a1a02
# Parent  979f8ccc314cd873e853fa9be6a72324c8ad119c
netfront: Unregister inetdev notifiers on failure
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@xxxxxxxxxx>
 drivers/xen/netfront/netfront.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletion(-)

diff -r 979f8ccc314c -r 86e119bc82c5 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Mon Mar 02 11:02:00 2009 +0000
+++ b/drivers/xen/netfront/netfront.c   Mon Mar 02 11:06:52 2009 +0000
@@ -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)
-       return xenbus_register_frontend(&netfront_driver);
+       err = xenbus_register_frontend(&netfront_driver);
+       if (err) {
+               unregister_inetaddr_notifier(&notifier_inetdev);
+       }
+       return err;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] netfront: Unregister inetdev notifiers on failure, Xen patchbot-linux-2.6.18-xen <=