[PATCH] flow: close socket fd on error
In eea8a76caf85 ("flow: fix podman issue #26073"), we unregister
the fd from epoll_ctl() in case of error, but we also need to close it.
As flowside_sock_l4() also calls sock_l4_sa() via flowside_sock_splice()
we can do it unconditionally.
Fixes: eea8a76caf85 ("flow: fix podman issue #26073")
Signed-off-by: Laurent Vivier
On Mon, 12 May 2025 18:47:00 +0200
Laurent Vivier
In eea8a76caf85 ("flow: fix podman issue #26073"), we unregister the fd from epoll_ctl() in case of error, but we also need to close it.
As flowside_sock_l4() also calls sock_l4_sa() via flowside_sock_splice() we can do it unconditionally.
The previous PIF_HOST check made sense to me because it excluded PIF_TAP, not so much because it excluded PIF_SPLICE. But anyway, we'll never reach here with anything that's not PIF_HOST nor PIF_TAP (kind of by definition), and a spurious epoll_del() is surely better than the alternative in any case...
Fixes: eea8a76caf85 ("flow: fix podman issue #26073") Signed-off-by: Laurent Vivier
Applied, thanks. New release coming soon. -- Stefano
On Mon, May 12, 2025 at 11:20:50PM +0200, Stefano Brivio wrote:
On Mon, 12 May 2025 18:47:00 +0200 Laurent Vivier
wrote: In eea8a76caf85 ("flow: fix podman issue #26073"), we unregister the fd from epoll_ctl() in case of error, but we also need to close it.
As flowside_sock_l4() also calls sock_l4_sa() via flowside_sock_splice() we can do it unconditionally.
The previous PIF_HOST check made sense to me because it excluded PIF_TAP, not so much because it excluded PIF_SPLICE.
Right. pif_is_socket() exists for exactly that case..
But anyway, we'll never reach here with anything that's not PIF_HOST nor PIF_TAP (kind of by definition), and a spurious epoll_del() is surely better than the alternative in any case...
..but in this case it's not relevant because you have to already have a socket by this point.
Fixes: eea8a76caf85 ("flow: fix podman issue #26073") Signed-off-by: Laurent Vivier
Applied, thanks. New release coming soon.
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson
participants (3)
-
David Gibson
-
Laurent Vivier
-
Stefano Brivio