Re: [PATCH RDMA/netlink v2] RDMA/netlink: Adhere to returning zero on success

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 16, 2019 at 01:04:36PM +0100, Håkon Bugge wrote:
> In rdma_nl_rcv_skb(), the local variable err is assigned the return
> value of the supplied callback function, which could be one of
> ib_nl_handle_resolve_resp(), ib_nl_handle_set_timeout(), or
> ib_nl_handle_ip_res_resp(). These three functions all return skb->len
> on success.
>
> rdma_nl_rcv_skb() is merely a copy of netlink_rcv_skb(). The callback
> functions used by the latter have the convention: "Returns 0 on
> success or a negative error code".
>
> In particular, the statement (equal for both functions):
>
>    if (nlh->nlmsg_flags & NLM_F_ACK || err)
>
> implies that rdma_nl_rcv_skb() always will ack a message, independent
> of the NLM_F_ACK being set in nlmsg_flags or not.
>
> The fix could be to change the above statement, but it is better to
> keep the two *_rcv_skb() functions equal in this respect and instead
> change the callback functions in the rdma subsystem to the correct
> convention.
>
> Suggested-by: Mark Haywood <mark.haywood@xxxxxxxxxx>
> Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx>
> Tested-by: Mark Haywood <mark.haywood@xxxxxxxxxx>
> Fixes: 2ca546b92a02 ("IB/sa: Route SA pathrecord query through netlink")
> Fixes: ae43f8286730 ("IB/core: Add IP to GID netlink offload")
>
> ---
>     v1 -> v2:
>        * Realized sk_buff::len is unsigned, hence simply returning
>          zero in the good case
> ---
>  drivers/infiniband/core/addr.c     | 2 +-
>  drivers/infiniband/core/sa_query.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>

Better to put Fixes above *-by tags.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux