Skip to content

Commit 1672086

Browse files
committed
SUNRPC: Fix sockaddr handling in svcsock_accept_class trace points
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: a0469f4 ("SUNRPC: Replace dprintk call sites in TCP state change callouts") Signed-off-by: Chuck Lever <[email protected]>
1 parent dc6c6fb commit 1672086

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/trace/events/sunrpc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,17 +2125,17 @@ DECLARE_EVENT_CLASS(svcsock_accept_class,
21252125
TP_STRUCT__entry(
21262126
__field(long, status)
21272127
__string(service, service)
2128-
__array(unsigned char, addr, sizeof(struct sockaddr_in6))
2128+
__field(unsigned int, netns_ino)
21292129
),
21302130

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

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

0 commit comments

Comments
 (0)