# Re: IPv4/IPv6 sysctl unregistration deadlock

- From: Herbert Xu \<herbert@gondor.apana.org.au\>
- Date: 2009-02-25 08:43:26 
- List: netdev
- Page: https://ratatoskr.run/netdev/2009/02/10818805
- Thread: https://ratatoskr.run/netdev/2009/02/10818776/t.md

```text
On Wed, Feb 25, 2009 at 08:18:47AM +0100, Patrick McHardy wrote:
>
> Unfortunately its more complicated than I thought because of
> device renames, where the sysctl pointer is reused after
> unregistration and the rename/unregistration/re-registration
> should be atomic. Deferring unregistration means we can't perform
> the new registration immediately unless we allow multiple
> registrations for a single device to be active simulaneously,
> which introduces a whole new set of problems.

Good point.

> Simply ignoring the request during unregistration doesn't seem
> so bad after all, the main problem is that it intoduces a different
> race on renames where a write to the "forwarding" file returns
> success, but the change doesn't take effect. We could return
> -ENOENT, but that seems a bit strange after open() returned success.
> Maybe -EBUSY, although I would prefer to make this transparent
> to userspace.

I'd like to avoid that for the rename case just because shell
scripts know how to deal with echo foo > /nonexist/file but not
necessarily a failed echo on write/close.

> I think I'm stuck. Will rethink it after some coffee :)

Yes we need more coffee :)

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} [ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
```
