NFSD: Add tracepoints for EXCHANGEID edge cases
authorChuck Lever <chuck.lever@oracle.com>
Fri, 14 May 2021 19:56:19 +0000 (15:56 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 18 May 2021 17:44:03 +0000 (13:44 -0400)
Some of the most common cases are traced. Enough infrastructure is
now in place that more can be added later, as needed.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c
fs/nfsd/trace.h

index b6da4ab..aa645ae 100644 (file)
@@ -3178,6 +3178,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                        }
                        /* case 6 */
                        exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
+                       trace_nfsd_clid_confirmed_r(conf);
                        goto out_copy;
                }
                if (!creds_match) { /* case 3 */
@@ -3190,6 +3191,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                }
                if (verfs_match) { /* case 2 */
                        conf->cl_exchange_flags |= EXCHGID4_FLAG_CONFIRMED_R;
+                       trace_nfsd_clid_confirmed_r(conf);
                        goto out_copy;
                }
                /* case 5, client reboot */
@@ -3203,11 +3205,13 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
                goto out;
        }
 
-       unconf  = find_unconfirmed_client_by_name(&exid->clname, nn);
+       unconf = find_unconfirmed_client_by_name(&exid->clname, nn);
        if (unconf) /* case 4, possible retry or client restart */
                unhash_client_locked(unconf);
 
-       /* case 1 (normal case) */
+       /* case 1, new owner ID */
+       trace_nfsd_clid_fresh(new);
+
 out_new:
        if (conf) {
                status = mark_client_expired_locked(conf);
@@ -3237,8 +3241,10 @@ out:
 out_nolock:
        if (new)
                expire_client(new);
-       if (unconf)
+       if (unconf) {
+               trace_nfsd_clid_expire_unconf(&unconf->cl_clientid);
                expire_client(unconf);
+       }
        return status;
 }
 
index 33fba6d..39b7cae 100644 (file)
@@ -636,6 +636,7 @@ DEFINE_EVENT(nfsd_clid_class, nfsd_clid_##name, \
        TP_ARGS(clp))
 
 DEFINE_CLID_EVENT(fresh);
+DEFINE_CLID_EVENT(confirmed_r);
 
 /*
  * from fs/nfsd/filecache.h