Enabling CONFIG_PROVE_LOCKING reveals some compilation errors and
running it shows that loading the root pointer needs to be done with
rcu_dereference_protected() (which will permit the load if the lock is
held) instead of a plain rcu_dereference() (which permits the load if
the rcu read lock is held).
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
static inline void mas_root_expand(struct ma_state *mas, void *entry)
{
- void *r_entry = rcu_dereference(mas->tree->ma_root); // root entry
+ void *r_entry = rcu_dereference_protected(mas->tree->ma_root,
+ lockdep_is_held(&mas->tree->ma_lock));
struct maple_node *mn;
enum maple_type mt = mas_ptype_leaf(mas);
int slot = 0;