From patchwork Fri Nov 25 17:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13056172 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 52A74C4321E for ; Fri, 25 Nov 2022 17:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbiKYRDN (ORCPT ); Fri, 25 Nov 2022 12:03:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiKYRDL (ORCPT ); Fri, 25 Nov 2022 12:03:11 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A073A26AC8; Fri, 25 Nov 2022 09:03:09 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 0D0AA5FD0B; Fri, 25 Nov 2022 20:03:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1669395788; bh=hIsvyQKroiddHpaTVR2wY29J7IQ5VqM86kcghxyeuSM=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ggMFBYROTK0lyPJPUDAbCu1X+1e9Jl/HQMoliWUPNJ9lwXOXNhitBph374CaykvuH ZRMqCFhCoB+56aaTIZHL3KF0ePPKNERNkUQWsJM2+OQxn07+H490NxHzR164UTUTv3 EyQP9n2Sz0hl76z4HTBPDhuc3jI7LcaPWgwdaQBCmQiqi0tntWgOOk2olsN0+fsBX+ TXTMSAk0YLxVxPQj9doIYlVU879LRh01P1kYS6gRnui5LnVEGlEN7wUwk6URQ8BiX7 jaKSY1/LyXv/rAPnP9k/SH4nHGBP+seWTTHqlcIB7lPZtpCyMNearrL9nV2N1eKKNV uO0j+weZ1Rv7A== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 25 Nov 2022 20:03:06 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "David S. Miller" , "edumazet@google.com" , "Jakub Kicinski" , Paolo Abeni , "kys@microsoft.com" , "haiyangz@microsoft.com" , "wei.liu@kernel.org" , "Dexuan Cui" , Bryan Tan , Vishnu Dasa , Arseniy Krasnov , "Krasnov Arseniy" , Bobby Eshleman , Bobby Eshleman CC: "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , kernel Subject: [RFC PATCH v2 1/6] vsock: return errors other than -ENOMEM to socket Thread-Topic: [RFC PATCH v2 1/6] vsock: return errors other than -ENOMEM to socket Thread-Index: AQHZAO/JdW+nx2oM60ahOLF9t/m+FQ== Date: Fri, 25 Nov 2022 17:03:06 +0000 Message-ID: <84f44358-dd8b-de8f-b782-7b6f03e0a759@sberdevices.ru> In-Reply-To: <9d96f6c6-1d4f-8197-b3bc-8957124c8933@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: <816FF44AD1235C4FAB598C4AD43152C1@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/11/25 14:59:00 #20610704 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; }