tcp_splice: Remove redundant tcp_splice_epoll_ctl()

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@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2023-11-07 13:42:40 +11:00 committed by Stefano Brivio
parent f6d8dc2355
commit d33cbc600e

View file

@ -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) 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)) if (tcp_splice_epoll_ctl(c, new))
conn_flag(c, new, CLOSING); conn_flag(c, new, CLOSING);
} }