[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20131204.013638.2211412920346095879.davem@davemloft.net>
Date: Wed, 04 Dec 2013 01:36:38 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: dingtianhong@...wei.com
Cc: gaofeng@...fujitsu.com, yoshfuji@...ux-ipv6.org, joe@...ches.com,
vfalico@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: neighbour: add neighbour dead check for
neigh_timer_handler()
From: Ding Tianhong <dingtianhong@...wei.com>
Date: Wed, 4 Dec 2013 14:19:06 +0800
> Yes, you are right, but when the timer is running and prior to get
> the neigh->lock, the refcnt could be dec to 0, you could not stop it
> by existing mechanism.
>
> the refcnt of neighbour could only be inc by these actions:
>
> 1.create neighbour, the refcnt will be set to 1.
> 2.add timer, the refcnt++.
> 3.neigh_lookup, if found the neigh, refcnt++.
The refcnt cannot dec to 0 if the timer is running, that's why
the last action of the timer handler is neigh_release().
The timer handler always holds a reference to the neighbour entry for
which it is running, that is why it must always release it.
If it can dec to 0, then this neigh_release() call in the timer
handler is illegal. But it is not.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists