]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
krbd: avoid udev netlink socket overrun
authorIlya Dryomov <idryomov@gmail.com>
Thu, 26 Sep 2019 16:06:27 +0000 (18:06 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 16 Oct 2019 14:56:10 +0000 (16:56 +0200)
commit5444a1111523bc100bea60958b2671674f6208ac
tree1d26389bc77261908a2b0a5b73e6140d1f8b08ca
parent53aab34dafcca2ec022102a03905e59cfa34fc84
krbd: avoid udev netlink socket overrun

Because the event(s) we are interested in can be deliveled while we are
still in the kernel finishing map or unmap, we start listening for udev
events before going into the kernel.  However, if (un)mapping takes its
time, udev netlink socket can be fairly easily overrun -- the filtering
is done on the listener side, so we get to process everything, not just
rbd events.  If any of the events of interest get dropped (ENOBUFS), we
hang in poll().

Go into the kernel in a separate thread and leave the main thread to
run the event loop.  The return value is communicated to the reactor
though a pipe.

Fixes: https://tracker.ceph.com/issues/41404
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/krbd.cc