Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1793039rwl; Thu, 30 Mar 2023 01:21:27 -0700 (PDT) X-Google-Smtp-Source: AKy350bHoyC33viBcmvcs3UcKGeUGMjHcX6RWYIshcmiBykR+J4fpNhEyy7vBgqu3MFuEuMa10Ra X-Received: by 2002:a17:906:7382:b0:93b:dddf:4be2 with SMTP id f2-20020a170906738200b0093bdddf4be2mr1004930ejl.3.1680164486879; Thu, 30 Mar 2023 01:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680164486; cv=none; d=google.com; s=arc-20160816; b=OzZRMaKN7ma0pI8Je0zRaom0Rw5ghS/WJOx+MBQVEZAui3D+6yL3PR6lU77a6jtqcf dEW0o4cTMbb+pOlN5uTSDSDLDnAMiUGFcn7KiRYb/XZXgWt/1g4vHWuuZYlfbxrzCbp7 tfNVuyPPG1idRVJADbrDX/yXEcmy4FfbYVb7hx5plIHFbFd4OzR58A20wbUOcKPus8Qz rrcAJna69WO4NHj0XwAWEwYulmrmTcC6vlcNkJgrCiQQvbyleeBxTseQv9J8RDjKrmBH raoZnvJ9w13rS8Hq3n8dqSn0bjZV8UPWQSH+GIDiojDSLkVzFTpdHNbgiPDN2S/8nbs2 XP3A== 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=j6eqKpHQyukUldknWnkYJ906zqmkvEYnde83ajid2aw=; b=y4ZrO6ttAHfQQ5KEkPdL+omSl3fHsaBEu9a3tJn+/wgmZYLGS9V+jwXa3+AsjgL3jB RDd5F0AlIysGDRKMjphbKlpOSE06dJiiXzR8Kz4glVvO3RgfyMrqchXk5WoNOhF2popm 7lb8QtU5QNUWgbWL2N7Wpo8N3M1hBcguZDilpalsQOjFDGYIewsLx1Yv9QDUoDrWb2Ao Buah3lsL8hA587lg585mCn7Y7KCdR4pNPVHzez56o7/IlPTM5GM9X38hK6EgaaPoyB7W ecTz591y57XNHJsml94DBcKVtjIB2ANjQP1fzwKF7gOJQSdtftkKSgIsy33wQJghoohb T0wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TJgXybOZ; 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 bi22-20020a170906a25600b0093dffa36a23si15695502ejb.502.2023.03.30.01.21.01; Thu, 30 Mar 2023 01:21:26 -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=TJgXybOZ; 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 S230202AbjC3IT4 (ORCPT + 99 others); Thu, 30 Mar 2023 04:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjC3ITz (ORCPT ); Thu, 30 Mar 2023 04:19:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8C140CA for ; Thu, 30 Mar 2023 01:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680164348; 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=j6eqKpHQyukUldknWnkYJ906zqmkvEYnde83ajid2aw=; b=TJgXybOZeBO9gyKO8o2hnCpH78RqCWx6fbHnTRfvw0GhooGSnfvUAFFZ9h9BauTQw4pMhI 00ftn/6NJvv4Rc6717JPb0dQrS7gK5V8OOjM2+YGY97pMVUQR1kfH71NValgWYalflOP9Z DvetYy9brqSte1EhqyaGOBbBlGsPtis= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-k8Tw6VqDPi-m64XkD33aig-1; Thu, 30 Mar 2023 04:19:07 -0400 X-MC-Unique: k8Tw6VqDPi-m64XkD33aig-1 Received: by mail-qk1-f197.google.com with SMTP id x80-20020a376353000000b0074681bc7f42so8533717qkb.8 for ; Thu, 30 Mar 2023 01:19:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680164347; 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=j6eqKpHQyukUldknWnkYJ906zqmkvEYnde83ajid2aw=; b=DlrWEW3raqqxlqdkMOAix7L+67VSLhasYE1rI937b0v/CVb1qo3UrABUsu7xFOMnoM DjT7XqAZOg4v/nQexGIfIRHKqWbdB7UrULC+2wxGSvNgMRUFss5jhuViXRE88EW1JAbb rCichV0q96BtIlpU6wOECZMepYjIGIDgo7eZnwN7Zr0HjQ9AvOb8MGYJi630I0mXaWud 4VjI9N4Ki5kbpf34YXrNIqqxjN9UqPvnB6CXUuDEODIAmvpH4XNJ9tFl16INV2H8GMGQ HuUhvTDkQ0YyB8Ql7aXrC1y1Sxe/V/FILF5Y0aZe+LGJelNYJTu4DuncXQJ4nEEKR3e4 n7Og== X-Gm-Message-State: AO0yUKVENuK4ZZhibzAd4b7oaqfMdkxgd7koJKG962Kylz7mBHNJH9pI 9IVjyqbe0Ekja991ehqmf9P0KGfN3b44noYKssFqdL/EiQGpzy/utgNWVE6VTNeV/SuuZz0hUyi FR4s+zGpcg3HxGuhWh/d3uIRB X-Received: by 2002:ac8:5852:0:b0:3dd:f4cd:9457 with SMTP id h18-20020ac85852000000b003ddf4cd9457mr33846455qth.10.1680164347091; Thu, 30 Mar 2023 01:19:07 -0700 (PDT) X-Received: by 2002:ac8:5852:0:b0:3dd:f4cd:9457 with SMTP id h18-20020ac85852000000b003ddf4cd9457mr33846439qth.10.1680164346857; Thu, 30 Mar 2023 01:19:06 -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 r14-20020ac867ce000000b003c034837d8fsm16827815qtp.33.2023.03.30.01.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 01:19:06 -0700 (PDT) Date: Thu, 30 Mar 2023 10:19:00 +0200 From: Stefano Garzarella To: Arseniy Krasnov , Vishnu Dasa Cc: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , 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 v2 2/3] vsock/vmci: convert VMCI error code to -ENOMEM Message-ID: References: <60abc0da-0412-6e25-eeb0-8e32e3ec21e7@sberdevices.ru> <94d33849-d3c1-7468-72df-f87f897bafd2@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <94d33849-d3c1-7468-72df-f87f897bafd2@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 Thu, Mar 30, 2023 at 10:07:36AM +0300, Arseniy Krasnov wrote: >This adds conversion of VMCI specific error code to general -ENOMEM. It >is needed, because af_vsock.c passes error value returned from transport >to the user. > >Signed-off-by: Arseniy Krasnov >--- > net/vmw_vsock/vmci_transport.c | 19 ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) > >diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c >index 36eb16a40745..45de3e75597f 100644 >--- a/net/vmw_vsock/vmci_transport.c >+++ b/net/vmw_vsock/vmci_transport.c >@@ -1831,10 +1831,17 @@ static ssize_t vmci_transport_stream_dequeue( > size_t len, > int flags) > { >+ int err; Please, use the same type returned by the function. >+ > if (flags & MSG_PEEK) >- return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0); >+ err = vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0); > else >- return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0); >+ err = vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0); >+ >+ if (err < 0) >+ err = -ENOMEM; >+ >+ return err; > } > > static ssize_t vmci_transport_stream_enqueue( >@@ -1842,7 +1849,13 @@ static ssize_t vmci_transport_stream_enqueue( > struct msghdr *msg, > size_t len) > { >- return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >+ int err; Ditto. >+ >+ err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >+ if (err < 0) >+ err = -ENOMEM; >+ >+ return err; > } @Vishnu: should we backport the change for vmci_transport_stream_enqueue() to stable branches? In this case I would split this patch and I would send the vmci_transport_stream_enqueue() change to the net branch including: Fixes: c43170b7e157 ("vsock: return errors other than -ENOMEM to socket") Thanks, Stefano