Skip to content
Commit d29e89e3 authored by Roland Kammerer's avatar Roland Kammerer Committed by Jens Axboe
Browse files

drbd: narrow rcu_read_lock in drbd_sync_handshake



So far there was the possibility that we called
genlmsg_new(GFP_NOIO)/mutex_lock() while holding an rcu_read_lock().

This included cases like:

drbd_sync_handshake (acquire the RCU lock)
  drbd_asb_recover_1p
    drbd_khelper
      drbd_bcast_event
        genlmsg_new(GFP_NOIO) --> may sleep

drbd_sync_handshake (acquire the RCU lock)
  drbd_asb_recover_1p
    drbd_khelper
      notify_helper
        genlmsg_new(GFP_NOIO) --> may sleep

drbd_sync_handshake (acquire the RCU lock)
  drbd_asb_recover_1p
    drbd_khelper
      notify_helper
        mutex_lock --> may sleep

While using GFP_ATOMIC whould have been possible in the first two cases,
the real fix is to narrow the rcu_read_lock.

Reported-by: default avatarJia-Ju Bai <baijiaju1990@163.com>
Reviewed-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: default avatarRoland Kammerer <roland.kammerer@linbit.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3a762de5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment