From patchwork Fri Nov 25 17:05:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13056174 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 D6139C4332F for ; Fri, 25 Nov 2022 17:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiKYRF7 (ORCPT ); Fri, 25 Nov 2022 12:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbiKYRF5 (ORCPT ); Fri, 25 Nov 2022 12:05:57 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C12C64509E; Fri, 25 Nov 2022 09:05:56 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 216685FD0B; Fri, 25 Nov 2022 20:05:55 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1669395955; bh=6S4rZ+E4xI3yfUr3aYJ38SvqnWz2eVSuw2pv6/QpiK8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=r1T5ehDxv8YVZlA5nOFJ9LzIPKkiUXT6333nm/rTdPH0LX6W+e6PF1fd7LkHxMrMr XFDB3pYhv3VmidVeaO6vnGnLNUqbreGVaj2XORwqIUfzKzPzCIX/RnymjWD33ItOVA WmwDxpNNuFUQ+Jsz/10mza82fn4fAcoTsC1WxNO2e+hOhB+aJIuqndSzM6utWc5ISN SofdJbAVTmrMV4JarvyPSPMN+/cyTbySixH3NXETMZMxqM8alurRANZMLadUE4aVGl Ti82ieK4EGFcnvg0OHOcRNKqGgVx4lMZmsWJYz9uxGw/+6zg5MCBcXrx0FEd/57LRM it8WNLdzEEn3Q== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 25 Nov 2022 20:05:54 +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 2/6] hv_sock: always return ENOMEM in case of error Thread-Topic: [RFC PATCH v2 2/6] hv_sock: always return ENOMEM in case of error Thread-Index: AQHZAPAtTYc9d9ztWkmT9FbeEy5mXA== Date: Fri, 25 Nov 2022 17:05:53 +0000 Message-ID: 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: <77BCA4140E868A459BF33144BC93E2B5@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 saves original behaviour from af_vsock.c - switch any error code returned from transport layer to ENOMEM. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/hyperv_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c index 59c3e2697069..fbbe55133da2 100644 --- a/net/vmw_vsock/hyperv_transport.c +++ b/net/vmw_vsock/hyperv_transport.c @@ -687,7 +687,7 @@ static ssize_t hvs_stream_enqueue(struct vsock_sock *vsk, struct msghdr *msg, if (bytes_written) ret = bytes_written; kfree(send_buf); - return ret; + return ret < 0 ? -ENOMEM : ret; } static s64 hvs_stream_has_data(struct vsock_sock *vsk)