[Devel] [PATCH RHEL9 COMMIT] net: zerocopy for unix socket, fixup again

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 26 19:00:44 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-362.8.1.vz9.35.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-362.8.1.vz9.35.17
------>
commit ac99955d070e80491764d80889c3d7ad5fbbb885
Author: Alexey Kuznetsov <kuznet at virtuozzo.com>
Date:   Fri Apr 26 23:21:29 2024 +0800

    net: zerocopy for unix socket, fixup again
    
    Serious bug, acks for partial writes were missing.
    
    Unfortunately this was not seen while normal work.
    In vstorage context it shows itself when a CS is restarted.
    Then client may hang for 5 seconds closing each socket, which
    triggers shaman timeout.
    
    https://pmc.acronis.work/browse/VSTOR-84977
    
    Fixes: 137e8807d5b0 ("net: zerocopy over unix sockets")
    Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
    Feature: net: zerocopy over unix sockets
---
 net/unix/af_unix.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 2f4d192cceca..5ca5b3233274 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2171,7 +2171,12 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
 		send_sig(SIGPIPE, current, 0);
 	err = -EPIPE;
 out_err:
-	net_zcopy_put_abort(uarg, true);
+	if (uarg) {
+		if (!sent)
+			net_zcopy_put_abort(uarg, true);
+		else
+			net_zcopy_put(uarg);
+	}
 	scm_destroy(&scm);
 	return sent ? : err;
 }


More information about the Devel mailing list