Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4385551rwl; Mon, 3 Apr 2023 04:22:59 -0700 (PDT) X-Google-Smtp-Source: AKy350bVM9NrUL4IQm9ApF1HZBt/Dpl+gTZNo+ts7wyTIZuTNapiSr7mW3UgkLGEESkVFScBE5q9 X-Received: by 2002:a17:902:e0c3:b0:1a2:92a4:f38c with SMTP id e3-20020a170902e0c300b001a292a4f38cmr10827195pla.13.1680520979496; Mon, 03 Apr 2023 04:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680520979; cv=none; d=google.com; s=arc-20160816; b=eA106biEwV/5YpPFPL/FRKTY4BcPIDIVOzDVEqrThj9TEmOmPsFuE98BvKp9CccELM GeNfjN3QFw4r3l+S1Q2Eff8EGiSAWMZhd5TTgaBrMsyDJ/vz4+akBf2Dwu1Kv580YPV0 /EdTZR8NQeVGW7xVhu2cTY9GhFkKdnLjQJQry/P1EV9EsxwSh2EI3g7C1ojaAb06k8DQ FQ+jTsogZ1EVkhdNTqwSsz7LAtF4qxPnXENnuJYbtGquBrHVX90OBqvuH2tYdM5M5W36 J23B57J8qG/wCIJlV0arFPgsP07rbDWaYzVgle5stuCR2DYmrclY75J4vmw0LNf9SlGq llaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ur1wtGFej11roMtg3KU2Y0Q1CPjhKzuCIJeUQ2U0Vpk=; b=xlrgNAfSzMh9I4IfD6ncS+vC/QW9ph/si+zDag6AzZzJwfj0zpnciMz11Vnyk3sIRE Ygov4OiycHCloGp5fVOt6V6cUVCH3bPDXBy72ASz1K5Yvbm92Ox/pjVy1rgbxBNwxbqA AcxtDtjZlFycPBTZIbEFo4m+TjS+YQ7hjhuxJBZi8eAjdkX2ycepZXb0maOWAJFL1PHQ sSAAW2AfoCTb4jKp8Qj/cHPv2eFT0d60bPNcofnaoYo1JuxAxhkX+2RDTN4XMobuW2fZ WHQp3Nqa+OVs+d37/PbGxc7qv4oAvre7Fw7XGhOhZNE6tiiquxEZzJs9ApcH1pNGZofM LDMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="jJtoOU/7"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a1709026b0a00b0019ceb61f48csi7431601plk.60.2023.04.03.04.22.47; Mon, 03 Apr 2023 04:22:59 -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=@redhat.com header.s=mimecast20190719 header.b="jJtoOU/7"; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232376AbjDCLQx (ORCPT + 99 others); Mon, 3 Apr 2023 07:16:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232303AbjDCLQv (ORCPT ); Mon, 3 Apr 2023 07:16:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A18F661A1 for ; Mon, 3 Apr 2023 04:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680520543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ur1wtGFej11roMtg3KU2Y0Q1CPjhKzuCIJeUQ2U0Vpk=; b=jJtoOU/7QKY1/S76Z41qlhZGBkfvuscdHMGtDv1hlk/uLwdJqGARhkbj+1oD0QNhtdOEe+ oXhzuisrlrDAoWPgCsptB+fexuh4y5oXn/DG/9PoI/7BCvYMTBPx+thWujhDYHxzXduaK1 tQhTsnzRIDIm0RgGhO7ixmF04Kx701c= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-163-gFb5lOuINEuoCntyOJoo5w-1; Mon, 03 Apr 2023 07:15:42 -0400 X-MC-Unique: gFb5lOuINEuoCntyOJoo5w-1 Received: by mail-qt1-f199.google.com with SMTP id t15-20020a05622a180f00b003e37dd114e3so19579015qtc.10 for ; Mon, 03 Apr 2023 04:15:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680520541; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ur1wtGFej11roMtg3KU2Y0Q1CPjhKzuCIJeUQ2U0Vpk=; b=kUZkqk7k663XHXfs43W3gwr4o7RV6aKke5/PB9yxpXvUW62ZGt0x3aJN3zWSKjPLSX UxkgXve2BIhBtr4xcS6cz4KcWcO2B7aX/1bEzAOgXvodOnFTWoQrjtwPc10DDdbPgmpE tn/em8ROmjDBmFPCVbWu1Gb7fAxrhshEG0WLMQZ2vqoTszfhiLsyrmxmD5dQziP/gUwd oFujIHsVPc8x01ooHiJsmUOmzFFAPVbUP1rCUrmO+x9pC3CLm6TEmxLErKg3ZtO3upux h8EQ2TcRvkEiDzPbIxY4hm967HUy8LekgoRULnm1LOcfAsq0J259r2bt5sAIFDnXce3V qSJA== X-Gm-Message-State: AO0yUKULgdxD2vsI923qzQdbWayNd2XBfDMlEwXV8aFZcgiGGVAeX17x 7OpxO6/kxdjudPbYr5rpgrbxeEJPt5lhjPMme8RsEIu1uXl9MgVmpXAjxMW3kbOvNjFYVCM2YOq HqDXMFBDwt3HR6ZY8IvTI4psxoT6L3m/Q X-Received: by 2002:ac8:5cd2:0:b0:3bf:a061:6cb1 with SMTP id s18-20020ac85cd2000000b003bfa0616cb1mr62090923qta.46.1680520541583; Mon, 03 Apr 2023 04:15:41 -0700 (PDT) X-Received: by 2002:ac8:5cd2:0:b0:3bf:a061:6cb1 with SMTP id s18-20020ac85cd2000000b003bfa0616cb1mr62090843qta.46.1680520540973; Mon, 03 Apr 2023 04:15:40 -0700 (PDT) Received: from sgarzare-redhat (host-82-57-51-130.retail.telecomitalia.it. [82.57.51.130]) by smtp.gmail.com with ESMTPSA id m124-20020a375882000000b0073b8745fd39sm2682759qkb.110.2023.04.03.04.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 04:15:40 -0700 (PDT) Date: Mon, 3 Apr 2023 13:15:35 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , Vishnu Dasa , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru, oxffffaa@gmail.com, pv-drivers@vmware.com Subject: Re: [RFC PATCH v4 2/3] vsock: return errors other than -ENOMEM to socket Message-ID: References: <5440aa51-8a6c-ac9f-9578-5bf9d66217a5@sberdevices.ru> <7715fd7f-1c50-7202-03c7-9d17c7f63cab@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <7715fd7f-1c50-7202-03c7-9d17c7f63cab@sberdevices.ru> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Sun, Apr 02, 2023 at 09:16:46PM +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(-) LGTM! Reviewed-by: Stefano Garzarella > >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 >