jamal wrote:
On Tue, 2005-22-11 at 04:14 +0100, Patrick McHardy wrote:

jamal wrote:


Of course, the underlying assumption is that in fact it could happen.
Could it actually happen? Because if that was the case, a lot of code in
the net area would need to be audited and fixed.

I don't see anything preventing it - which would be taking the RTNL
in this case. But I think most code is probably still OK because
in most cases sysctls aren't checked multiple times.


yes, RTNL is one but most of the ones i just inspected are protected
under dev_base_lock; so this should be sufficient, no?

You mean other sysctls? I guess it depends on which ones you're
talking about, but if they take a lock I assume its for a reason :)
The ones in devinet.c seem to be mostly using the regular proc_do...
functions however.

promote_secondaries uses ipv4_doint_and_flush which itself used
proc_dointvec without taking any locks, so the value can change
at any time.

I think i should remove the second check because it is redundant
actually regardless - but if serves the purpose of avoiding a race even
better.

The first one also needs to be moved out of the loop to be complete.

>
I didnt quiet follow - why would it be more complete if we moved it out
of the loop? Does this have something to do with syctl being reentered
multiple times?

If it changes from 0 to 1 while the loop is running half the secondaries
will get deleted and the next one promoted. It should either delete
all or promote the first secondary.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to