Thread (17 messages) 17 messages, 3 authors, 2022-12-05

Re: [RFC PATCH v2 1/6] vsock: return errors other than -ENOMEM to socket

From: Stefano Garzarella <sgarzare@redhat.com>
Date: 2022-12-01 09:19:26
Also in: linux-hyperv, lkml, virtualization

On Fri, Nov 25, 2022 at 05:03:06PM +0000, Arseniy Krasnov wrote:
From: Bobby Eshleman <redacted>

This removes behaviour, where error code returned from any
transport was always switched to ENOMEM.

Signed-off-by: Bobby Eshleman <redacted>
Signed-off-by: Arseniy Krasnov <redacted>
---
net/vmw_vsock/af_vsock.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
This patch LGTM, but I would move after the 2 patches that change vmci 
and hyperv transports.

First we should fix the transports by returning the error we think is 
right, and then expose it to the user.

Thanks,
Stefano
quoted hunk ↗ jump to hunk
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 884eca7f6743..61ddab664c33 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1862,8 +1862,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
			written = transport->stream_enqueue(vsk,
					msg, len - total_written);
		}
+
		if (written < 0) {
-			err = -ENOMEM;
+			err = written;
			goto out_err;
		}

-- 
2.25.1
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help