Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710138pxv; Thu, 15 Jul 2021 14:07:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7xYJNcOcGpHW12hz5OZE+kX8HoZoc7P0APnGwfEQIgxot1npdica+cX60VJAKqLVpOm/3 X-Received: by 2002:a17:906:cb8b:: with SMTP id mf11mr7595539ejb.297.1626383243050; Thu, 15 Jul 2021 14:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383243; cv=none; d=google.com; s=arc-20160816; b=AJzYSYLWjPeZTNl96t9fnOY4ouAJydo35TsF9WlJqFWQWztvWSD2SBaWCwMZSlKw6t YtwwiMjovpZEIWbOboqz68bSFMVhZiL7tnyl/+04a9EwM8E10hC/CgX4DVvrxsUz5Z8o 45gmDdN7KngnZCn/sXazmSN+oIOXhnwtuuFIM3sox4Bo63VFmYsn5iM1NbLsx/xpUsKh Y8LNOTd3peKf34Jkct5g8J1LLTKFpNVXUdI0PB4qkdSOdm+pp+qw97/x+XZmJ3FfgRSN 4u3HI2tZkav6GZaquKar885pCBL8JwYISE+fVv3TtO2EsP19eeItRNyfM/S4C5ihlG68 /pSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/z0oHjHxSGqTUsQFjoDPG4g63TRsp/2EmtuQ4p+NFdM=; b=kFRYCFT7EjBSorCfdgJu2oqCshpYKf86BWU5eiNg46Rjwk2CHf+Gba3N8vcjTi0INi gq2NWe22p1zuN6KAzPr6LOlCfANzAC1O7DPcVGbzTBfIXgaNP/WJ+mtcFn5RvW8ZKtuN Bk4qFC06u8si/I8tTfvnIk01JuVY568rBj4j3j5SPXC4ahV25ZgY6KOrASzuOwv0/TZr v9cXJs7AuejMhsiU5znOEIuW4kl1Xt/jEMoEHaDFgsUYqqzK+ZHxPYMuDqk442JRZghV Sde4CApTTm6OQ/AYZqbrYGyk9TQr7SHVWejMpvs6Rb0ZiaAReUvhbIA145p4ito/Kwzq Fzfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=epSY+3v+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si6575781eje.429.2021.07.15.14.07.00; Thu, 15 Jul 2021 14:07:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=epSY+3v+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244809AbhGOTSa (ORCPT + 99 others); Thu, 15 Jul 2021 15:18:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239033AbhGOTDR (ORCPT ); Thu, 15 Jul 2021 15:03:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14F1C61370; Thu, 15 Jul 2021 18:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375567; bh=EfgEJylRHF1NQY/Yx5XZyMIOkbTSyQmMOC7KGA5XTKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=epSY+3v+X1ZjapaqCkzYQlcnnyqwhGdE9qzZ+7w9zHeg18nZKMfDmryBuR6VKnurh eeLaFszSEzuOS2/VtJHevYi0aZ3qgWtnl0VwDvbzzBN8dlhUl3PT5e4LIjWbNu1Jhg n2oOKotgjNfdT1xDXhXi6lJZXmItGY53oy2o86Ng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiao Yang , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.12 115/242] RDMA/rxe: Dont overwrite errno from ib_umem_get() Date: Thu, 15 Jul 2021 20:37:57 +0200 Message-Id: <20210715182613.358387461@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiao Yang [ Upstream commit 20ec0a6d6016aa28b9b3299be18baef1a0f91cd2 ] rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get() fails so it's hard for user to know which actual error happens in ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP when trying to pin pages on a DAX file. Return actual error as mlx4/mlx5 does. Link: https://lore.kernel.org/r/20210621071456.4259-1-ice_yangxiao@163.com Signed-off-by: Xiao Yang Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index 9f63947bab12..fe2b7d223183 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -135,7 +135,7 @@ int rxe_mr_init_user(struct rxe_pd *pd, u64 start, u64 length, u64 iova, if (IS_ERR(umem)) { pr_warn("err %d from rxe_umem_get\n", (int)PTR_ERR(umem)); - err = -EINVAL; + err = PTR_ERR(umem); goto err1; } -- 2.30.2