From patchwork Sun Dec 4 19:19:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13064022 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 E221DC4321E for ; Sun, 4 Dec 2022 19:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbiLDTT0 (ORCPT ); Sun, 4 Dec 2022 14:19:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbiLDTTZ (ORCPT ); Sun, 4 Dec 2022 14:19:25 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DA85E0C9; Sun, 4 Dec 2022 11:19:23 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 87A465FD03; Sun, 4 Dec 2022 22:19:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1670181561; bh=hIsvyQKroiddHpaTVR2wY29J7IQ5VqM86kcghxyeuSM=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=jtCanZOOdFSJsyPk4hGtaNuwD7iSkkHRfHhYfHKoE3jLUx0anOR+UJIbHfx0jtCKU P/HPrTpnvJeosJYBcILYylYDwk5npVdbf7pRskiZwJXgpLB7f3T7jsymUAS8lwLitR eCstq7GozPKRV9AaOIpomhGn5QeyKpT71Iit35/Qaz2pZKy+wmzkBumJD2CfFbj/7E ivNRKnQxs4+wKqF72wF1nHiLADcokxazqa6Uy9gL9UtnUrwLQ69LgDGiTL4GzFrulX 64zEGk8e4lE/Z+7ryvXLc6kqVOLYvvmFZOd3CZZ1Yny8qYd4b1Lb5q/y1ntsoFrh8I 39EutZxqRsafw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sun, 4 Dec 2022 22:19:21 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "edumazet@google.com" , "David S. Miller" , "Jakub Kicinski" , Paolo Abeni CC: Bobby Eshleman , Krasnov Arseniy , Arseniy Krasnov , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , kernel Subject: [RFC PATCH v3 1/4] vsock: return errors other than -ENOMEM to socket Thread-Topic: [RFC PATCH v3 1/4] vsock: return errors other than -ENOMEM to socket Thread-Index: AQHZCBVPUxodrmNfCUeS2ScEDlgfUQ== Date: Sun, 4 Dec 2022 19:19:20 +0000 Message-ID: In-Reply-To: <6bd77692-8388-8693-f15f-833df1fa6afd@sberdevices.ru> 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: <4A8C54714356D4498F9AC846A04E186C@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/04 13:44:00 #20647742 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC From: Bobby Eshleman This removes behaviour, where error code returned from any transport was always switched to ENOMEM. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov --- 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 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; }