[Drbd-dev] rcu_dereference() called when not under rcu_read_lock().

Robert Altnoeder robert.altnoeder at linbit.com
Tue Jul 9 01:32:41 CEST 2019

On 08 Jul 2019, at 19:50, David Butterfield <dab21774 at gmail.com> wrote:
> It seems that in general rcu_dereference() is expected to be called under rcu_read_lock().


> [04]   0x5684b7  adm_new_connection drbd_nl.c:3774
> [05]   0x569643  drbd_adm_new_peer drbd_nl.c:4070


> [05]   0x546625  drbd_create_device drbd_main.c:3709
> [06]   0x570b85  drbd_adm_new_minor drbd_nl.c:5858

We’ll check, but I believe I remember those to be either initializers (no readers and writers yet) or updaters. The code probably does an rcu_assign_pointer() and then possibly a deallocation after synchronize_rcu(). The updaters are normally serialized with mutex locks (e.g. the resource’s conf_update), so they don’t race with each other.


More information about the drbd-dev mailing list