Skip to content

Commit 9320f27

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: add tracepoint in mark_client_expired_locked
Show client info alongside the number of cl_rpc_users. If that's elevated, then we can infer that this function returned nfserr_jukebox. [ cel: For additional debugging of RPC user refcounting ] Signed-off-by: Jeff Layton <[email protected]> Tested-by: Vladimir Benes <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 2d49901 commit 9320f27

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

fs/nfsd/nfs4state.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,11 @@ unhash_client(struct nfs4_client *clp)
23472347

23482348
static __be32 mark_client_expired_locked(struct nfs4_client *clp)
23492349
{
2350-
if (atomic_read(&clp->cl_rpc_users))
2350+
int users = atomic_read(&clp->cl_rpc_users);
2351+
2352+
trace_nfsd_mark_client_expired(clp, users);
2353+
2354+
if (users)
23512355
return nfserr_jukebox;
23522356
unhash_client_locked(clp);
23532357
return nfs_ok;

fs/nfsd/trace.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,30 @@ DEFINE_CLIENTID_EVENT(purged);
848848
DEFINE_CLIENTID_EVENT(renew);
849849
DEFINE_CLIENTID_EVENT(stale);
850850

851+
TRACE_EVENT(nfsd_mark_client_expired,
852+
TP_PROTO(
853+
const struct nfs4_client *clp,
854+
int cl_rpc_users
855+
),
856+
TP_ARGS(clp, cl_rpc_users),
857+
TP_STRUCT__entry(
858+
__field(int, cl_rpc_users)
859+
__field(u32, cl_boot)
860+
__field(u32, cl_id)
861+
__sockaddr(addr, clp->cl_cb_conn.cb_addrlen)
862+
),
863+
TP_fast_assign(
864+
__entry->cl_rpc_users = cl_rpc_users;
865+
__entry->cl_boot = clp->cl_clientid.cl_boot;
866+
__entry->cl_id = clp->cl_clientid.cl_id;
867+
__assign_sockaddr(addr, &clp->cl_cb_conn.cb_addr,
868+
clp->cl_cb_conn.cb_addrlen)
869+
),
870+
TP_printk("addr=%pISpc client %08x:%08x cl_rpc_users=%d",
871+
__get_sockaddr(addr), __entry->cl_boot, __entry->cl_id,
872+
__entry->cl_rpc_users)
873+
);
874+
851875
DECLARE_EVENT_CLASS(nfsd_net_class,
852876
TP_PROTO(const struct nfsd_net *nn),
853877
TP_ARGS(nn),

0 commit comments

Comments
 (0)