On 4/22/17 8:28 PM, Martin KaFai Lau wrote: >> The code path to fixup_permanent_addr is under RTNL, so the if check on >> ifp->rt and rt6i_ref is ok -- neither can be changed since RTNL is held. >> >> Since ifp->rt can be accessed outside of RTNL, the spinlock is needed to >> change its value. > Got it. It is to protect the readers which are not under RTNL. > Many thanks for pointing out what I was missing. It all makes sense now. > >> Arguably only 'ifp->rt = rt;' needs the spinlock. > It still seems like the existing 'ifp->rt = rt;' needs protection > anyway regardless of the rt regeneration change. It would be nice to > explain it in the commit log or even better separating it out > into another patch.
I'll add a comment to the commit log when I send a v3 tomorrow morning.