[Devel] [PATCH VZ9 2/2] net: zerocopy for unix socket, fixup again

Alexey Kuznetsov kuznet at virtuozzo.com
Fri Apr 26 18:21:29 MSK 2024


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

Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
---
 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 2f4d192..5ca5b32 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;
 }
-- 
1.8.3.1



More information about the Devel mailing list