Subject: Re: IPv4/IPv6 sysctl unregistration deadlock

From: Stephen Hemminger <[email-masked]>
Date: Thu, 26 Feb 2009 12:24:50 -0800

On Thu, 26 Feb 2009 11:01:41 -0800
[email-masked] (Eric W. Biederman) wrote:

> Stephen Hemminger <[email-masked]> 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" <[email-masked]>
> 
> 
> 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.
> 

I haven't tested it, but it should restart in VFS.
Spinning is not that big a deal, and it also handles the case
where the name changed or some other race occurred during processing.
When syscall is re-entered, the name will no longer be found and
-ENOENT will be returned.