Stefano Garzarella
2022-Dec-20 10:31 UTC
[RFC PATCH v5 1/4] vsock: return errors other than -ENOMEM to socket
On Tue, Dec 20, 2022 at 07:18:48AM +0000, Arseniy Krasnov wrote:>This removes behaviour, where error code returned from any transport >was always switched to ENOMEM. For example when user tries to send too >big message via SEQPACKET socket, transport layers return EMSGSIZE, but >this error code was always replaced with ENOMEM and returned to user. > >Signed-off-by: Bobby Eshleman <bobby.eshleman at bytedance.com> >Signed-off-by: Arseniy Krasnov <AVKrasnov at sberdevices.ru> >--- > net/vmw_vsock/af_vsock.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-)Reviewed-by: Stefano Garzarella <sgarzare at redhat.com>> >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index d593d5b6d4b1..19aea7cba26e 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -1861,8 +1861,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