Re: [PATCH 2/9] PKT_SCHED: tc filter extension API
From: Patrick McHardy <hidden>
Date: 2004-12-31 14:18:49
From: Patrick McHardy <hidden>
Date: 2004-12-31 14:18:49
Thomas Graf wrote:
* jamal [ref] 2004-12-30 23:36quoted
Patrick pointed this in other email: the xchg is sort of defeated by the else. Perhaps make the second one xchg as well.Agreed, I changed it to: struct tc_action *act; act = xchg(&dst->action, src->action); if (act) tcf_action_destroy(act, TCA_ACT_UNBIND); Am I missing something?
Yes, the xchg without locking is only right in case we don't have an existing action that needs to be destroyed. Someone might still be looking at the old action in a softirq. If you want to keep the "lockless" variant, you need to call synchronize_net() before tcf_action_destroy(). Regards Patrick