lkml.org 
[lkml]   [2021]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.12 120/160] RDMA/rxe: Don't overwrite errno from ib_umem_get()
    Date
    From: Xiao Yang <yangx.jy@fujitsu.com>

    [ 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 <yangx.jy@fujitsu.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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
    \
     
     \ /
      Last update: 2021-07-06 13:49    [W:4.036 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site