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

David Butterfield dab21774 at gmail.com
Mon Jul 8 19:50:49 CEST 2019


It seems that in general rcu_dereference() is expected to be called under rcu_read_lock().

I've observed that it is sometimes called without rcu_read_lock() -- for example the two call
stacks below that traverse the idr list.  Is something else protecting such that the
rcu_read_lock() is unnecessary in some cases?

idr_get_next() calls rcu_dereference(), but is called not under rcu_read_lock()
 [02]   0x5e9eeb  rwlock_assert_readlocked usermode_lib.h:1016 (discriminator 5)
 [03]   0x5fa816  idr_get_next idr.c:602
 [04]   0x5684b7  adm_new_connection drbd_nl.c:3774
 [05]   0x569643  drbd_adm_new_peer drbd_nl.c:4070

idr_find() calls rcu_dereference(), but is called not under rcu_read_lock()
 [02]   0x5e9eeb  rwlock_assert_readlocked usermode_lib.h:1016 (discriminator 5)
 [03]   0x5fa582  idr_find idr.c:507
 [04]   0x536970  minor_to_device drbd_int.h:1418
 [05]   0x546625  drbd_create_device drbd_main.c:3709
 [06]   0x570b85  drbd_adm_new_minor drbd_nl.c:5858


More information about the drbd-dev mailing list