]> 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>
Mon, 4 Nov 2019 11:43:20 +0000 (12:43 +0100)
commit9af0c7351facfd9b60e12c435b439a7dd54e7703
treed5e0cadc3a32efc451cd0959c2dacb95e06365fb
parent4b648abda58acaaabbcf3ff24e31d0cdaa447a99
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>
(cherry picked from commit 5444a1111523bc100bea60958b2671674f6208ac)

Conflicts:
src/krbd.cc [ krbd_spec, ceph_abort_msgf(), make_named_thread()
  not in luminous; luminous is compiled with -std=c++11 ]
src/krbd.cc