lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0816/1039] SUNRPC: Fix sockaddr handling in svcsock_accept_class trace points
    Date
    From: Chuck Lever <chuck.lever@oracle.com>

    [ Upstream commit 16720861675393a35974532b3c837d9fd7bfe08c ]

    Avoid potentially hazardous memory copying and the needless use of
    "%pIS" -- in the kernel, an RPC service listener is always bound to
    ANYADDR. Having the network namespace is helpful when recording
    errors, though.

    Fixes: a0469f46faab ("SUNRPC: Replace dprintk call sites in TCP state change callouts")
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    include/trace/events/sunrpc.h | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
    index 52288f1c1b52d..7b5dcff84cf27 100644
    --- a/include/trace/events/sunrpc.h
    +++ b/include/trace/events/sunrpc.h
    @@ -2147,17 +2147,17 @@ DECLARE_EVENT_CLASS(svcsock_accept_class,
    TP_STRUCT__entry(
    __field(long, status)
    __string(service, service)
    - __array(unsigned char, addr, sizeof(struct sockaddr_in6))
    + __field(unsigned int, netns_ino)
    ),

    TP_fast_assign(
    __entry->status = status;
    __assign_str(service, service);
    - memcpy(__entry->addr, &xprt->xpt_local, sizeof(__entry->addr));
    + __entry->netns_ino = xprt->xpt_net->ns.inum;
    ),

    - TP_printk("listener=%pISpc service=%s status=%ld",
    - __entry->addr, __get_str(service), __entry->status
    + TP_printk("addr=listener service=%s status=%ld",
    + __get_str(service), __entry->status
    )
    );

    --
    2.34.1


    \
     
     \ /
      Last update: 2022-09-17 16:14    [W:4.083 / U:1.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site