Re: [PATCH 1/2] mac80211: Use linked list instead of rhashtable walk for mesh tables

From
Herbert Xu <herbert@gondor.apana.org.au>
Date
2019-02-13 13:47:40
Also in
linux-wireless
Reply to
Herbert Xu, 2019-02-13
On Wed, Feb 13, 2019 at 01:16:13PM +0800, Herbert Xu wrote:
The mesh table code walks over hash tables for two purposes.  First of
all it's used as part of a netlink dump process, but it is also used
for looking up entries to delete using criteria other than the hash
key.

The second purpose is directly contrary to the design specification
of rhashtable walks.  It is only meant for use by netlink dumps.

This is because rhashtable is resizable and you cannot obtain a
stable walk over it during a resize process.

In fact mesh's use of rhashtable for dumping is bogus too.  Rather
than using rhashtable walk's iterator to keep track of the current
position, it always converts the current position to an integer
which defeats the purpose of the iterator.

Therefore this patch converts all uses of rhashtable walk into a
simple linked list.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
OK this patch is broken because there is no locking on the linked
list.  I'll repost the series.

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Thread (23 messages) 23 messages, 3 authors, last reply 2019-02-18
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help