Skip to content

Commit c65d9df

Browse files
chuckleverChuck Lever
authored andcommitted
SUNRPC: Make the svc_authenticate tracepoint conditional
Clean up: Simplify the tracepoint's only call site. Also, I noticed that when svc_authenticate() returns SVC_COMPLETE, it leaves rq_auth_stat set to an error value. That doesn't need to be recorded in the trace log. Signed-off-by: Chuck Lever <[email protected]> Reviewed-by: Jeff Layton <[email protected]>
1 parent 9315564 commit c65d9df

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/trace/events/sunrpc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,11 +1666,13 @@ TRACE_DEFINE_ENUM(SVC_COMPLETE);
16661666
#define SVC_RQST_ENDPOINT_VARARGS \
16671667
__entry->xid, __get_sockaddr(server), __get_sockaddr(client)
16681668

1669-
TRACE_EVENT(svc_authenticate,
1669+
TRACE_EVENT_CONDITION(svc_authenticate,
16701670
TP_PROTO(const struct svc_rqst *rqst, int auth_res),
16711671

16721672
TP_ARGS(rqst, auth_res),
16731673

1674+
TP_CONDITION(auth_res != SVC_OK && auth_res != SVC_COMPLETE),
1675+
16741676
TP_STRUCT__entry(
16751677
SVC_RQST_ENDPOINT_FIELDS(rqst)
16761678

net/sunrpc/svc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,8 +1280,7 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
12801280
/* Also give the program a chance to reject this call: */
12811281
if (auth_res == SVC_OK && progp)
12821282
auth_res = progp->pg_authenticate(rqstp);
1283-
if (auth_res != SVC_OK)
1284-
trace_svc_authenticate(rqstp, auth_res);
1283+
trace_svc_authenticate(rqstp, auth_res);
12851284
switch (auth_res) {
12861285
case SVC_OK:
12871286
break;

0 commit comments

Comments
 (0)