[libteam]: timerfd read() could return 0 fix (#3393)

* Update sonic-quagga submodule

* [libteam]: timerfd read() could return 0
This commit is contained in:
pavel-shirshov 2019-08-29 14:14:12 -07:00 committed by Ying Xie
parent c6655b8bdf
commit 6b43650245
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From 038bed6fe3970dc829dbf9a282f7bea7198e7826 Mon Sep 17 00:00:00 2001
From: Pavel Shirshov <pavelsh@microsoft.com.com>
Date: Wed, 28 Aug 2019 16:39:35 -0700
Subject: [PATCH] When read of timerfd returned 0, don't consider this an error
Just skip this event.
---
teamd/teamd.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index 96794e8..a5ce745 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -285,6 +285,10 @@ static int handle_period_fd(int fd)
teamd_log_err("read() failed.");
return -errno;
}
+ if (ret == 0) {
+ teamd_log_warn("read() for timer_fd returned 0.");
+ return 1;
+ }
if (ret != sizeof(uint64_t)) {
teamd_log_err("read() returned unexpected number of bytes.");
return -EINVAL;
@@ -345,7 +349,9 @@ static int teamd_run_loop_do_callbacks(struct list_item *lcb_list, fd_set *fds,
continue;
if (lcb->is_period) {
err = handle_period_fd(lcb->fd);
- if (err)
+ if (err == 1)
+ continue; /* timerfd returned 0. Don't do anything */
+ if (err < 0)
return err;
}
err = lcb->func(ctx, events, lcb->priv);
--
2.7.4

View File

@ -7,3 +7,4 @@
0007-Send-LACP-PDU-immediately-if-our-state-changed.patch
0008-libteam-Add-warm_reboot-mode.patch
0009-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
0010-When-read-of-timerfd-returned-0-don-t-consider-this-.patch