Skip to content

Commit

Permalink
rhashtable: Extend RCU read lock into rhashtable_insert_rehash()
Browse files Browse the repository at this point in the history
rhashtable_insert_rehash() requires RCU locks to be held in order
to access ht->tbl and traverse to the last table.

Fixes: ccd57b1 ("rhashtable: Add immediate rehash during insertion")
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Mar 24, 2015
1 parent 27cd545 commit 58be8a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/rhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,8 @@ static inline int __rhashtable_insert_fast(
if (unlikely(rht_grow_above_100(ht, tbl))) {
slow_path:
spin_unlock_bh(lock);
rcu_read_unlock();
err = rhashtable_insert_rehash(ht);
rcu_read_unlock();
if (err)
return err;

Expand Down

0 comments on commit 58be8a5

Please sign in to comment.