Message ID | a10ffbed-848d-df8c-ec4e-ba25c4c8e3e8@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4169380wrr; Fri, 25 Nov 2022 09:11:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf43cwHAfFd2Mw0Tg8QLuAJMRZJ+oNQ1+D9hjhr4xQ2+WA9qGtn7qphg7Hbv6pjt9OOjQ3Fr X-Received: by 2002:a63:d049:0:b0:470:71df:a6c3 with SMTP id s9-20020a63d049000000b0047071dfa6c3mr16481675pgi.447.1669396300800; Fri, 25 Nov 2022 09:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669396300; cv=none; d=google.com; s=arc-20160816; b=Jt6vRx5ljbirTkYauwjzivciyJPbKUbbLOybVYlVVA6DqcECBUGws+3rRgxqXAdEfm WuUW/jz/6/T9AQzMwOrxXCvUdOQ7gMMrORZCJupmwVvs0Gqv1fSgrImiSMmZbJojjb5W p07NrUkCvwcZ/TI+6V+SRU9Uu/kuvgjvR98+NiF5p054C25qKrkd7YjxFC38xrYYpJ4Y Wk/zHjhGcr5FOfnhEmKduPjQXzqx8VpCmEm2HLG05sIUqeCYu7nMHHws1xDS4R0RCZQg OgTZE1ZmCR7fYaDMe1YLoVyAdOqnNoaIhKVBNqBdGnj/kZaPTz17Km7nD99u8IyrVXlj JSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=6S4rZ+E4xI3yfUr3aYJ38SvqnWz2eVSuw2pv6/QpiK8=; b=SOutaNJOuR6f8VDVcrHYpQ6EAkaennG+HGOJJ3dQXbmdMR+wqF8rSkeiAgAA1iv9lL 0AtXuVR5Y0aDX0BZhBP8aQ9KP5rdyST5CP5FEWg1VygbsqhPcW6izcunCpCmJvhOJvs5 ll1+PRiPyTnj44516hKCsd3maGPmFAHkTa95ENrWch+7QFlcNnYoX74yXmL3AfY+DupA T/gKPHK6kxM1Fms1zivMNuI9kVOdQviK3jgF4NpK/Mw88FPYA90HH5FNwzGjJ5VJ96Ia ywu3OrfegJnsIJy/quUBLqyFqtB0CwNAKs8wmu0oN/C6C6iQ96+pr/weGSfKAIl2bgoN cdmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=r1T5ehDx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a170902cec200b00179f69eae64si4735405plg.620.2022.11.25.09.11.22; Fri, 25 Nov 2022 09:11:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=r1T5ehDx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230041AbiKYRF7 (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <AVKrasnov@sberdevices.ru> To: Stefano Garzarella <sgarzare@redhat.com>, "David S. Miller" <davem@davemloft.net>, "edumazet@google.com" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, "kys@microsoft.com" <kys@microsoft.com>, "haiyangz@microsoft.com" <haiyangz@microsoft.com>, "wei.liu@kernel.org" <wei.liu@kernel.org>, "Dexuan Cui" <decui@microsoft.com>, Bryan Tan <bryantan@vmware.com>, Vishnu Dasa <vdasa@vmware.com>, Arseniy Krasnov <AVKrasnov@sberdevices.ru>, "Krasnov Arseniy" <oxffffaa@gmail.com>, Bobby Eshleman <bobby.eshleman@gmail.com>, Bobby Eshleman <bobby.eshleman@bytedance.com> CC: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "virtualization@lists.linux-foundation.org" <virtualization@lists.linux-foundation.org>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>, kernel <kernel@sberdevices.ru> 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: <a10ffbed-848d-df8c-ec4e-ba25c4c8e3e8@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-Type: text/plain; charset="utf-8" Content-ID: <77BCA4140E868A459BF33144BC93E2B5@sberdevices.ru> Content-Transfer-Encoding: base64 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750488895154439489?= X-GMAIL-MSGID: =?utf-8?q?1750488895154439489?= |
Series |
vsock: update tools and error handling
|
|
Commit Message
Arseniy Krasnov
Nov. 25, 2022, 5:05 p.m. UTC
From: Bobby Eshleman <bobby.eshleman@bytedance.com> This saves original behaviour from af_vsock.c - switch any error code returned from transport layer to ENOMEM. Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> --- net/vmw_vsock/hyperv_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1
Comments
On Fri, Nov 25, 2022 at 05:05:53PM +0000, Arseniy Krasnov wrote: >From: Bobby Eshleman <bobby.eshleman@bytedance.com> > >This saves original behaviour from af_vsock.c - switch any error >code returned from transport layer to ENOMEM. > >Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> >Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >--- > 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; I'm not sure for hyperv we want to preserve -ENOMEM. This transport was added after virtio-vsock, so I think we can return the error directly. @Dexuan what do you think? Thanks, Stefano
> From: Stefano Garzarella <sgarzare@redhat.com> > Sent: Thursday, December 1, 2022 1:24 AM > > [...] > >--- 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; > > I'm not sure for hyperv we want to preserve -ENOMEM. This transport was > added after virtio-vsock, so I think we can return the error directly. > > @Dexuan what do you think? > > Thanks, > Stefano I also think we can return the error directly. BTW, I doubt any user really depends on the value of a non-zero error code.
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)