[PATCH 2.6.20 07/10] nfnetlink_log: fix
module reference counting
kaber at trash.net
Wed Feb 14 18:22:12 CET 2007
Micha³ Miros³aw wrote:
> On Wed, Feb 14, 2007 at 05:46:38PM +0100, Patrick McHardy wrote:
>>Micha³ Miros³aw wrote:
>>>On Tue, Feb 13, 2007 at 01:48:03PM +0100, Patrick McHardy wrote:
>>>>I think we should just cancel the timer on destruction.
>>>It won't solve a race between destroying the instance and logging a
>>>packet. It could happen that:
>>This is easily fixable by adding a synchronize_rcu() call
>>after removing the instance from the global list.
>>nfulnl_log_packet() is called within a RCU read-side
>>critical section, so once synchronize_rcu() returns we're
>>guaranteed no CPU is within nfulnl_log_packet anymore with
>>this instance. And I think it is really preferable to having
>>the timer armed after destroying the instance.
> That looks better indeed. I'll start on reading what's RCU and
> how to use it properly. :)
Unfortunately the patch is still broken, we might hold
instances_lock and thus may not sleep (and especially
not call synchronize_rcu() since it will never return).
I'll look into this again, probably the conditional
locking should be removed as a first step.
More information about the netfilter-devel