-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libteam]: timerfd read() could return 0 fix (#3393)
* Update sonic-quagga submodule * [libteam]: timerfd read() could return 0
- Loading branch information
1 parent
be3cbdb
commit 1c06ae6
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/libteam/patch/0010-When-read-of-timerfd-returned-0-don-t-consider-this-.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters