This is an automated email from the git hooks/post-receive script.
teigland pushed a commit to branch master
in repository sanlock.
commit d384a9cbc278756523ae59dd12131df78859a518
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Mar 9 15:21:35 2020 -0500
sanlock: clean up poll event checks for efd
Never look at clients array when checking efd.
(No evidence of any problems from this.)
---
src/main.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/main.c b/src/main.c
index d2e8c9a..5ed125b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -763,13 +763,27 @@ static int main_loop(void)
/* not sure */
}
for (i = 0; i <= client_maxi + 1; i++) {
- if (pollfd[i].fd == efd && pollfd[i].revents & POLLIN) {
- /* a client_resume completed */
- eventfd_read(efd, &ebuf);
+ /*
+ * This index for efd has no client array entry. Its
+ * only purpose is to wake up this poll loop in which
+ * case we just clear any data and continue looking
+ * for other client entries that need processing.
+ */
+ if (pollfd[i].fd == efd) {
+ if (pollfd[i].revents & POLLIN) {
+ eventfd_read(efd, &ebuf);
+ }
continue;
}
+
+ /*
+ * FIXME? client_maxi is never reduced so over time we
+ * end up checking and skipping some number of unused
+ * client entries here which seems inefficient.
+ */
if (client[i].fd < 0)
continue;
+
if (pollfd[i].revents & POLLIN) {
workfn = client[i].workfn;
if (workfn)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date