All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>, zyjzyj2000@gmail.com
Cc: linux-rdma@vger.kernel.org, jgg@ziepe.ca
Subject: Re: [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op()
Date: Thu, 13 Mar 2025 14:30:34 +0200	[thread overview]
Message-ID: <20250313123034.GL1322339@unreal> (raw)
In-Reply-To: <20250313064540.2619115-1-matsuda-daisuke@fujitsu.com>

On Thu, Mar 13, 2025 at 03:45:40PM +0900, Daisuke Matsuda wrote:
> rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP
> counterpart must not return raw errno codes.
> 
> Signed-off-by: Daisuke Matsuda <matsuda-daisuke@fujitsu.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_odp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_odp.c b/drivers/infiniband/sw/rxe/rxe_odp.c
> index 94f7bbe14981..9f6e2bb2a269 100644
> --- a/drivers/infiniband/sw/rxe/rxe_odp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_odp.c
> @@ -316,7 +316,7 @@ int rxe_odp_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,
>  	err = rxe_odp_map_range_and_lock(mr, iova, sizeof(char),
>  					 RXE_PAGEFAULT_DEFAULT);
>  	if (err < 0)
> -		return err;
> +		return RESPST_ERR_RKEY_VIOLATION;

I applied this patch for now, but please work to remove enum
resp_states. It is very bad practice to hide original in-kernel errors.

thanks

>  
>  	err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add,
>  				   orig_val);
> -- 
> 2.43.0
> 

  reply	other threads:[~2025-03-13 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  6:45 [PATCH for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() Daisuke Matsuda
2025-03-13 12:30 ` Leon Romanovsky [this message]
2025-03-13 12:30 ` Leon Romanovsky
2025-03-13 12:36 ` Zhu Yanjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250313123034.GL1322339@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matsuda-daisuke@fujitsu.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.