tcp_splice_conn_update() calls tcp_splice_epoll_ctl() twice: first ignoring the return value, then checking it. This serves no purpose. If the first call succeeds, the second call will do exactly the same thing again, since nothing has changed in conn. If the first call fails, then tcp_splice_epoll_ctl() itself will EPOLL_CTL_DEL both fds, meaning when the second call tries to EPOLL_CTL_MOD them it will necessarily fail. It appears that this duplication was introduced by accident in an otherwise unrelated patch. Fixes: bb708111 ("treewide: Packet abstraction with mandatory boundary checks") Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- tcp_splice.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tcp_splice.c b/tcp_splice.c index 19f5406..fd6ce8d 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -255,7 +255,6 @@ static void conn_event_do(const struct ctx *c, struct tcp_splice_conn *conn, */ void tcp_splice_conn_update(const struct ctx *c, struct tcp_splice_conn *new) { - tcp_splice_epoll_ctl(c, new); if (tcp_splice_epoll_ctl(c, new)) conn_flag(c, new, CLOSING); } -- 2.41.0