From: Davidlohr Bueso Date: Thu, 3 Jan 2019 23:27:12 +0000 (-0800) Subject: fs/epoll: robustify ep->mtx held checks X-Git-Tag: Ubuntu-5.13.0-19.19~9416^2~36 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=21877e1a5b520132f54515f8835c963056418b4c;p=mirror_ubuntu-jammy-kernel.git 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@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/eventpoll.c b/fs/eventpoll.c index fb7f05f4099d..68e27d1cb5cd 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1637,6 +1637,8 @@ static __poll_t ep_send_events_proc(struct eventpoll *ep, struct list_head *head * 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;