The branch, master has been updated via 39d0a81 lib: tevent: Whitespace cleanup. via 2be3dd1 lib: tevent: Fix bug in poll backend - poll_event_loop_poll() from d967789 ctdb-scripts: Fix CTDB_DBDIR=tmpfs support
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 39d0a81ed87c58836335ec10af22b36c9961f91e Author: Jeremy Allison <j...@samba.org> Date: Tue Nov 17 09:13:41 2015 -0800 lib: tevent: Whitespace cleanup. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> Autobuild-User(master): Volker Lendecke <v...@samba.org> Autobuild-Date(master): Wed Nov 18 15:54:03 CET 2015 on sn-devel-104 commit 2be3dd1407eabe3df360ede2eab178848e34733c Author: Jeremy Allison <j...@samba.org> Date: Tue Nov 17 10:28:50 2015 -0800 lib: tevent: Fix bug in poll backend - poll_event_loop_poll() If the (pfd->revents & POLLNVAL) case is triggered, we do DLIST_REMOVE(ev->fd_events, fde); and then use fde->next in the loop above. Save off fde->next for loop interation before this so we can't use a deleted ->next value. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> ----------------------------------------------------------------------- Summary of changes: lib/tevent/tevent_epoll.c | 6 +++--- lib/tevent/tevent_poll.c | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c index 01fcde6..507ea5c 100644 --- a/lib/tevent/tevent_epoll.c +++ b/lib/tevent/tevent_epoll.c @@ -216,7 +216,7 @@ static void epoll_update_event(struct epoll_event_context *epoll_ev, struct teve /* reopen the epoll handle when our pid changes - see http://junkcode.samba.org/ftp/unpacked/junkcode/epoll_fork.c for an + see http://junkcode.samba.org/ftp/unpacked/junkcode/epoll_fork.c for an demonstration of why this is needed */ static void epoll_check_reopen(struct epoll_event_context *epoll_ev) @@ -661,7 +661,7 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval } for (i=0;i<ret;i++) { - struct tevent_fd *fde = talloc_get_type(events[i].data.ptr, + struct tevent_fd *fde = talloc_get_type(events[i].data.ptr, struct tevent_fd); uint16_t flags = 0; struct tevent_fd *mpx_fde = NULL; @@ -888,7 +888,7 @@ static void epoll_event_set_fd_flags(struct tevent_fd *fde, uint16_t flags) } /* - do a single event loop using the events defined in ev + do a single event loop using the events defined in ev */ static int epoll_event_loop_once(struct tevent_context *ev, const char *location) { diff --git a/lib/tevent/tevent_poll.c b/lib/tevent/tevent_poll.c index 573ba93..9b1781f 100644 --- a/lib/tevent/tevent_poll.c +++ b/lib/tevent/tevent_poll.c @@ -498,6 +498,7 @@ static int poll_event_loop_poll(struct tevent_context *ev, int timeout = -1; int poll_errno; struct tevent_fd *fde = NULL; + struct tevent_fd *next = NULL; unsigned i; if (ev->signal_events && tevent_common_check_signal(ev)) { @@ -542,11 +543,13 @@ static int poll_event_loop_poll(struct tevent_context *ev, which ones and call the handler, being careful to allow the handler to remove itself when called */ - for (fde = ev->fd_events; fde; fde = fde->next) { + for (fde = ev->fd_events; fde; fde = next) { uint64_t idx = fde->additional_flags; struct pollfd *pfd; uint16_t flags = 0; + next = fde->next; + if (idx == UINT64_MAX) { continue; } -- Samba Shared Repository