Message ID | 20250313064540.2619115-1-matsuda-daisuke@fujitsu.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [for-next] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() | expand |
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 >
On Thu, 13 Mar 2025 15:45:40 +0900, Daisuke Matsuda wrote: > rxe_mr_do_atomic_op() returns enum resp_states numbers, so the ODP > counterpart must not return raw errno codes. > > Applied, thanks! [1/1] RDMA/rxe: Fix incorrect return value of rxe_odp_atomic_op() https://git.kernel.org/rdma/rdma/c/9e98eb80c518e1 Best regards,
On 13.03.25 07:45, 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> Thanks. I am fine with it. Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev> Zhu Yanjun > --- > 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; > > err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add, > orig_val);
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; err = rxe_odp_do_atomic_op(mr, iova, opcode, compare, swap_add, orig_val);
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(-)