[PATCH] Bug Fix: cache_include: Fix object ref release after successful object update

Thomas Graf tgraf at suug.ch
Mon Dec 17 10:51:06 EST 2012


On 12/17/12 at 06:51am, Roopa Prabhu wrote:
> The put for old here is releasing the reference held due to
> nl_cache_search.

Of course, I can see it now. We definitely need to release the
ref from nl_cache_search() so I applied your patch.

> But i see what you are saying, if we want to hold references for the
> updates, then its probably better if we do it in the oo_update
> function. Because updates can be adding or deleting elements from
> the old object. For example in the route case, we will need to
> increase reference on adding the next hop and decrement the ref
> count on deleting the next hop. Otherwise we will keep incrementing
> the ref count of old in all cases. And no one will be decrementing.
> 
> Having said that, I don't see a strong reason to hold references
> for the updates. If you think we should, one option for me is to respin
> the ipv6 route update patch to hold appropriate references, unless
> you have any other ideas.

I agree, we don't need to hold references for the updates. Holding 
a ref for the original route is enough.



More information about the libnl mailing list