From patchwork Tue Dec 20 07:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13077559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9329EC10F1E for ; Tue, 20 Dec 2022 07:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233260AbiLTHTK (ORCPT ); Tue, 20 Dec 2022 02:19:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233015AbiLTHSw (ORCPT ); Tue, 20 Dec 2022 02:18:52 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC40E36; Mon, 19 Dec 2022 23:18:50 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id D47015FD04; Tue, 20 Dec 2022 10:18:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1671520728; bh=gfJ1Wma4/Hix29ezKPf1BskSsFg9wHKm3F+uGRcLIc8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=PzvFDntaH3xlMg9EKiv5JUBq5YjAv4vQnSQH+05tkDJKTwcfGe+n25mxou2kzlcnW sK3eHc98X+9Vam/cjPt8j05X5OPiJGL20LBdg/XKAxO03wl6/Cm1qKtwX/TDK9L72W tiEGELmQxBZkdUGa8Agn+EndYFH+5zPIrzJs7gh9Ri3hgnWS7nZ8J/1zKqYRCJqIa0 FM7BFF6oEYYO1fqfxSlPRNQU5IXEv6lpf2vSNl0CGjz5BOWSFgalcGvhVZtzByTnAO WAZqNL2ZLkCWEXxn/FuwFkZLj/l7AhzzFZvJ8IseiSan0JajjK1LM6N0KxDKuvYO6c Ku+UCzR4QhbFQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 20 Dec 2022 10:18:48 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "David S. Miller" , "edumazet@google.com" , "Paolo Abeni" , Jakub Kicinski CC: "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , kernel , Bobby Eshleman , Krasnov Arseniy , Arseniy Krasnov Subject: [RFC PATCH v5 1/4] vsock: return errors other than -ENOMEM to socket Thread-Topic: [RFC PATCH v5 1/4] vsock: return errors other than -ENOMEM to socket Thread-Index: AQHZFENNrsKIykYAGk6rMUuI0TO6ow== Date: Tue, 20 Dec 2022 07:18:48 +0000 Message-ID: In-Reply-To: Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-ID: <63ACCD85517FFA40975768490B61028C@sberdevices.ru> MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/12/20 03:38:00 #20687629 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC 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 Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }