[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1241110115.938.1603.camel@calx>
Date: Thu, 30 Apr 2009 11:48:35 -0500
From: Matt Mackall <mpm@...enic.com>
To: Bruno Prémont <bonbons@...ux-vserver.org>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH, resend] netconsole: take care of NETDEV_UNREGISTER
event
On Thu, 2009-04-30 at 08:45 +0200, Bruno Prémont wrote:
> When netconsole is loaded and a network interface fades away (e.g. on
> rmmod $interface_driver_module) the rmmod remains stuck and some locks
> are taken that prevent any additional module loading/unloading as well
> as interface up/down changes.
> In addition kernel logs (and console) get flooded at 10s interval with
>
> [ 122.464065] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
> [ 132.704059] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
>
> This patch lets netconsole take NETDEV_UNREGISTER event into account
> and release the affected interface if it was in use.
>
> Signed-off-by: Bruno Prémont <bonbons@...ux-vserver.org>
Acked-by: Matt Mackall <mpm@...enic.com>
> ---
> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> index eceadf7..bf4af52 100644
> --- a/drivers/net/netconsole.c
> +++ b/drivers/net/netconsole.c
> @@ -664,7 +664,7 @@ static int netconsole_netdev_event(struct notifier_block *this,
> struct netconsole_target *nt;
> struct net_device *dev = ptr;
>
> - if (!(event == NETDEV_CHANGENAME))
> + if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER))
> goto done;
>
> spin_lock_irqsave(&target_list_lock, flags);
> @@ -675,6 +675,15 @@ static int netconsole_netdev_event(struct notifier_block *this,
> case NETDEV_CHANGENAME:
> strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
> break;
> + case NETDEV_UNREGISTER:
> + if (!nt->enabled)
> + break;
> + netpoll_cleanup(&nt->np);
> + nt->enabled = 0;
> + printk(KERN_INFO "netconsole: network logging stopped"
> + ", interface %s unregistered\n",
> + dev->name);
> + break;
> }
> }
> netconsole_target_put(nt);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
http://selenic.com : development and support for Mercurial and Linux
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists