Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1851804rwl; Thu, 30 Mar 2023 02:20:09 -0700 (PDT) X-Google-Smtp-Source: AKy350YX7wuEtAJbbqHDqM8ihCSb3qLbGjY7J83XzntQVsUkyTEL/4Mlh3/FHjryfFQwJJsWPcoL X-Received: by 2002:a05:6402:4315:b0:502:616b:cbd5 with SMTP id m21-20020a056402431500b00502616bcbd5mr1973473edc.2.1680168009002; Thu, 30 Mar 2023 02:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680168008; cv=none; d=google.com; s=arc-20160816; b=QGYmCjvVWoGUmQm+DlGT5VsOWe6buqxjZkXatCDpcfj+/CwRB3KdtyYVBsImz1nlaa UH29pHpVq6xgZ1cJOsLTvsd1eznZIEvhBQQAoH7J7iCWTNx84yoauF+KIf+X+/qjumjL VTUp3rrQo4F+YSSiJMn6XDc+d7B4N+XnSRvBu4VWtN2qiMQWu7F9+lIk7rBhSzUZp9Z2 R3sYokcTR5PkfUqIUu8IXja2EH4kL6xvUPsbC6kfWRf09IF31PjfriDKC7oWWbLceA3C Pky/lUyaM2+y+DUIAQmEbkzSvDQ43WdaAZUL2rdO60BqfhjQRlApHjp/bof7EfuimLxF kDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=RYJMvFbojXg3R5X/dk91cDXmm8PXnGq/ROukKXRmzZY=; b=QUXxDDRevI/LN6O+paFJyifJtBEGDetxhrseafHGgSKZN83T5TecdWWStbWEq1ChLW vpbcoCMnwofETn7Yom5ZWmramBi8uHGKUVt3fIkOY9t/NKKnedJ04c0fXiWeSRcySiBH GOZteiVRTztNNVE3vjiaHds3fDVturgfwxeK8G9VigmctwgOFtt1rq5kQQq+CKxljvkr nJYv3Zmtnr1bc9fH79UtimlY2gXhvC33dsoCtDj/iCPsWY0dJfNFBtIK+Wu9n7hc7vGs fP46HRzDuBXnSU3B48owA+NmVbtUJj2i4MGVCeQdwqvkwYFCgXYQKDfXmbTmx/aEcyCM tg4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=RSVZMxiO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a2-20020aa7d742000000b004aef1baf38asi1147781eds.96.2023.03.30.02.19.43; Thu, 30 Mar 2023 02:20:08 -0700 (PDT) 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=RSVZMxiO; 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 S230324AbjC3JMA (ORCPT + 99 others); Thu, 30 Mar 2023 05:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbjC3JL6 (ORCPT ); Thu, 30 Mar 2023 05:11:58 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BF697AA7; Thu, 30 Mar 2023 02:11:50 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 5B8855FD25; Thu, 30 Mar 2023 12:11:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1680167507; bh=RYJMvFbojXg3R5X/dk91cDXmm8PXnGq/ROukKXRmzZY=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=RSVZMxiOgwXyz0sUrROyRorsxNo8Gh2DYz/ll75I/RDoTDydMrv4qdfjWTFLEfUAM ke/2e17GQ2mPtT50b+eQAHXG17FC2oV841sreK7FyGisPaIBhJlgBrxkDAG243z4JF ii9NTHkTQABbQBeHbbTKFdQMW9hQR14+PAp6bvBnF2Dt0dJ0gma/0UHnpLZcMYsy2n iOlY3qJIHnHxYFMNrtfQpj6r7pK02TytvjbkAtM7lIiU7VcZGcaz0uM0CyruPiB5tB bTW8GtEcvMJ14iHaEz+d32/uClpM66aksbWyq/d52waa/aUCgB/yHDmCcUlAAvUfvA AUFZekP5iaozg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 30 Mar 2023 12:11:42 +0300 (MSK) Message-ID: <5e294fdb-5a19-140c-e5cb-e5ba00acec58@sberdevices.ru> Date: Thu, 30 Mar 2023 12:08:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC PATCH v2 1/3] vsock: return errors other than -ENOMEM to socket Content-Language: en-US To: Stefano Garzarella CC: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , Vishnu Dasa , , , , , , , References: <60abc0da-0412-6e25-eeb0-8e32e3ec21e7@sberdevices.ru> From: Arseniy Krasnov In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) 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: 2023/03/30 06:33:00 #21047900 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On 30.03.2023 11:02, Stefano Garzarella wrote: > On Thu, Mar 30, 2023 at 10:05:45AM +0300, Arseniy Krasnov wrote: >> This removes behaviour, where error code returned from any transport >> was always switched to ENOMEM. This works in the same way as: >> commit >> c43170b7e157 ("vsock: return errors other than -ENOMEM to socket"), >> but for receive calls. >> >> Signed-off-by: Arseniy Krasnov >> --- >> net/vmw_vsock/af_vsock.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) > > We should first make sure that all transports return the right value, > and then expose it to the user, so I would move this patch, after > patch 2. Yes, right! I'll reorder patches and fix VMCI patch after reply from @Vishnu Thanks, Arseniy > > Thanks, > Stefano > >> >> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >> index 5f2dda35c980..413407bb646c 100644 >> --- a/net/vmw_vsock/af_vsock.c >> +++ b/net/vmw_vsock/af_vsock.c >> @@ -2043,7 +2043,7 @@ static int __vsock_stream_recvmsg(struct sock *sk, struct msghdr *msg, >> >>         read = transport->stream_dequeue(vsk, msg, len - copied, flags); >>         if (read < 0) { >> -            err = -ENOMEM; >> +            err = read; >>             break; >>         } >> >> @@ -2094,7 +2094,7 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg, >>     msg_len = transport->seqpacket_dequeue(vsk, msg, flags); >> >>     if (msg_len < 0) { >> -        err = -ENOMEM; >> +        err = msg_len; >>         goto out; >>     } >> >> --  >> 2.25.1 >> >