The patch titled Subject: fs/epoll: robustify ep->mtx held checks has been added to the -mm tree. Its filename is fs-epoll-robustify-ep-mtx-held-checks.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fs-epoll-robustify-ep-mtx-held-checks.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fs-epoll-robustify-ep-mtx-held-checks.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Davidlohr Bueso <dave@xxxxxxxxxxxx> Subject: fs/epoll: robustify ep->mtx held checks Insted of just commenting how important it is, lets make it more robust and add a lockdep_assert_held() call. Link: http://lkml.kernel.org/r/20181108051006.18751-5-dave@xxxxxxxxxxxx Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Jason Baron <jbaron@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/eventpoll.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/eventpoll.c~fs-epoll-robustify-ep-mtx-held-checks +++ a/fs/eventpoll.c @@ -1637,6 +1637,8 @@ static __poll_t ep_send_events_proc(stru * Items cannot vanish during the loop because ep_scan_ready_list() is * holding "mtx" during this call. */ + lockdep_assert_held(&ep->mtx); + list_for_each_entry_safe(epi, tmp, head, rdllink) { if (esed->res >= esed->maxevents) break; _ Patches currently in -mm which might be from dave@xxxxxxxxxxxx are fs-epoll-remove-max_nests-argument-from-ep_call_nested.patch fs-epoll-simplify-ep_send_events_proc-ready-list-loop.patch fs-epoll-drop-ovflist-branch-prediction.patch fs-epoll-robustify-ep-mtx-held-checks.patch fs-epoll-reduce-the-scope-of-wq-lock-in-epoll_wait.patch fs-epoll-reduce-the-scope-of-wq-lock-in-epoll_wait-fix.patch fs-epoll-avoid-barrier-after-an-epoll_wait2-timeout.patch fs-epoll-avoid-barrier-after-an-epoll_wait2-timeout-fix.patch