Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp144908rwl; Thu, 30 Mar 2023 13:32:15 -0700 (PDT) X-Google-Smtp-Source: AKy350YeuYFnsSv6NuVVz/Q++8ya9JvKsk3jyjoDgExXQsqQj/G3DkMqzQs92kF4eRnXAkx8B+ko X-Received: by 2002:a05:6402:1e8e:b0:502:465:28e1 with SMTP id f14-20020a0564021e8e00b00502046528e1mr3905842edf.0.1680208335187; Thu, 30 Mar 2023 13:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680208335; cv=none; d=google.com; s=arc-20160816; b=CRyoEKLBRfUaTx4MCvgBxJ3Vuxdf9L+/Ohwp3lbR9MIb8+bSRBeeJHQ6qjp0q5OPTo QQNJLVE74fW4NIs62oI5T9Lj3Ea0rSG7WxA/l3wYLDcQYgyFJQ3Dk97+XBUBY/cRtvIS EXJ/tH9eg8+duldjSpZS/O9n7HXOEC5UeSbDUD5X8HuM/yn+2QKc7U6zfmBjDAS88oh/ 62UnIcIYISdNKPqMl43hKdmVM+IuxE2Q3+sXbWbJpsWIGoGDHfKt20K8yHcfR14/ACr/ pzGYxcUQU5pCjJAXVp7DCGFbdZl4Xcq1nSlPCNw0p+wtpbgATJxDnEuyq1PSJSz4myof SpUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :in-reply-to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=Bmxyh54lX6vx3ZvD3CMgQVOYil7AZCn1e5XpBZtA3TI=; b=PqWdXd/FODjqggNEnsYMZCU0l5n5v1yCzinNGbCM/r/NRh4kco1JZHshIBG7TJPlmi G+Mj9sKlb+neAOSFmIIUfg3qrO364afM9KcPK83IGBeRhyX6vED9pleExY4N+Is1P97f TeZa70N/RXohCJQRArq9cQNMQERge7tUaEFbrZctAYTafqimE8zGFQ3U/MfAiaFhQFna aHqqeMVn0tlAhKEgcR7xueu1JYjryQoztushx6Uw5Ka6CzDeI0JHOl8W4DRC9XXYA3G/ 9VManjhKVmlHlM/olYIoXn9epfqe30hGIDqDi7pMPTT7aWGu/YgXdZ8tYvvEBJtpSNYI HJhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Dxc66ArH; 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 b19-20020aa7c913000000b004bc4fc261f8si493134edt.102.2023.03.30.13.31.49; Thu, 30 Mar 2023 13:32:15 -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=Dxc66ArH; 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 S229724AbjC3UQR (ORCPT + 99 others); Thu, 30 Mar 2023 16:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjC3UQP (ORCPT ); Thu, 30 Mar 2023 16:16:15 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE963D53B; Thu, 30 Mar 2023 13:16:11 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 05AA75FD0B; Thu, 30 Mar 2023 23:16:10 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1680207370; bh=Bmxyh54lX6vx3ZvD3CMgQVOYil7AZCn1e5XpBZtA3TI=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=Dxc66ArHyPpBcSE8UnUuR5unLlbZsRAblKuFnLSsNz4AUg/lz0wbnVaho85ynfQy+ Iha6hIM9y5EEA75Q6Q038Sxd6CJgozGZyBSL3yUuMw0+ryyXbnUaZiVftUNTfqNZkK V9hs87zr6jSqy2seEbWTJNnFCujxCi8+pc92DqtW2UrwxtKvuiLHbaJuy7DfGCH9ko GxIMZBM3n5XxhV8bV3gtkxGJGk+Bgl/P96OSsPV6uipvlflL9mPYODUFUD9SuzQwcO i4KlytpmrbFQa23Su8SHhSo4VrGy706Aue0ShC80mwm1O7s7fOFHmpQlX/GOuca7L1 9/VaVPKMSlXjw== 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 23:16:09 +0300 (MSK) Message-ID: Date: Thu, 30 Mar 2023 23:12:44 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US In-Reply-To: To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , Vishnu Dasa CC: , , , , , , , From: Arseniy Krasnov Subject: [RFC PATCH v3 1/4] vsock/vmci: convert VMCI error code to -ENOMEM on send Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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 18:07:00 #21069213 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,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 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, which does not expect to get VMCI_ERROR_* values. Fixes: c43170b7e157 ("vsock: return errors other than -ENOMEM to socket") Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/vmci_transport.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 36eb16a40745..95cc4d79ba29 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -1842,7 +1842,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); + ssize_t err; + + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); + if (err < 0) + err = -ENOMEM; + + return err; } static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk) -- 2.25.1