Skip to content

Commit c4d2603

Browse files
herbertxdavem330
authored andcommitted
rhashtable: Fix RCU dereference annotation in rht_bucket_nested
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: da20420 ("rhashtable: Add nested tables") Reported-by: Fengguang Wu <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ca43540 commit c4d2603

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/rhashtable.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,12 +1121,13 @@ struct rhash_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
11211121
union nested_table *ntbl;
11221122

11231123
ntbl = (union nested_table *)rcu_dereference_raw(tbl->buckets[0]);
1124-
ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash);
1124+
ntbl = rht_dereference_bucket_rcu(ntbl[index].table, tbl, hash);
11251125
subhash >>= tbl->nest;
11261126

11271127
while (ntbl && size > (1 << shift)) {
11281128
index = subhash & ((1 << shift) - 1);
1129-
ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash);
1129+
ntbl = rht_dereference_bucket_rcu(ntbl[index].table,
1130+
tbl, hash);
11301131
size >>= shift;
11311132
subhash >>= shift;
11321133
}

0 commit comments

Comments
 (0)