rhashtable: Fix RCU dereference annotation in rht_bucket_nested
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 25 Feb 2017 14:39:50 +0000 (22:39 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Feb 2017 02:33:43 +0000 (21:33 -0500)
The current annotation is wrong as it says that we're only called
under spinlock.  In fact it should be marked as under either
spinlock or RCU read lock.

Fixes: da20420f83ea ("rhashtable: Add nested tables")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c

index fac1a78afb3917d63cd8ac39e6aa938116ea5167..c5b9b9351cec8acdf5fcdafaf88fc58562896391 100644 (file)
@@ -1121,12 +1121,13 @@ struct rhash_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
        union nested_table *ntbl;
 
        ntbl = (union nested_table *)rcu_dereference_raw(tbl->buckets[0]);
-       ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash);
+       ntbl = rht_dereference_bucket_rcu(ntbl[index].table, tbl, hash);
        subhash >>= tbl->nest;
 
        while (ntbl && size > (1 << shift)) {
                index = subhash & ((1 << shift) - 1);
-               ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash);
+               ntbl = rht_dereference_bucket_rcu(ntbl[index].table,
+                                                 tbl, hash);
                size >>= shift;
                subhash >>= shift;
        }