[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1ab89m38q.fsf@fess.ebiederm.org>
Date: Thu, 26 Feb 2009 11:01:41 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Stephen Hemminger <shemminger@...tta.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
Patrick McHardy <kaber@...sh.net>,
Linux Netdev List <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: IPv4/IPv6 sysctl unregistration deadlock
Stephen Hemminger <shemminger@...tta.com> writes:
> What about something like this:
>
> Subject: [PATCH] Avoid race between network down and sysfs
As far as solutions go. That looks like the easiest correct solution.
So.
Acked-by: "Eric W. Biederman" <ebiederm@...ssion.com>
Will -ERESTARTSYS trigger the in kernel restart logic in this case?
There are a lot more cases to cover, and I don't I like it long
term. Spinning waiting for rtnl_lock feels wrong. Plus it does
not help with discovering the problem in new sysfs, sysctl, or
proc files.
It has the major advantage that we can fix things now.
> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
>
> --- a/net/core/net-sysfs.c 2009-02-26 08:36:18.000000000 -0800
> +++ b/net/core/net-sysfs.c 2009-02-26 08:37:51.000000000 -0800
> @@ -77,7 +77,9 @@ static ssize_t netdev_store(struct devic
> if (endp == buf)
> goto err;
>
> - rtnl_lock();
> + if (!rtnl_trylock())
> + return -ERESTARTSYS;
> +
> if (dev_isalive(net)) {
> if ((ret = (*set)(net, new)) == 0)
> ret = len;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists