aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-20 21:59:40 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:27 -0400
commit08cb47faa4687342e9cbde54ff0f15a768eb5632 (patch)
tree6d05a119e96c4de5602532e1687d57195148a3f1
parent2f92ae343e2358a4936c2470debfc4424b29eb3e (diff)
NFSv4.1: Add tracepoints for debugging test_stateid events
Add tracepoints to detect issues with the TEST_STATEID operation. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c3
-rw-r--r--fs/nfs/nfs4trace.h49
2 files changed, 52 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a745f7c41758..1671e1f1fe0d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1950,6 +1950,7 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state)
1950 cred = get_rpccred(delegation->cred); 1950 cred = get_rpccred(delegation->cred);
1951 rcu_read_unlock(); 1951 rcu_read_unlock();
1952 status = nfs41_test_stateid(server, stateid, cred); 1952 status = nfs41_test_stateid(server, stateid, cred);
1953 trace_nfs4_test_delegation_stateid(state, NULL, status);
1953 } else 1954 } else
1954 rcu_read_unlock(); 1955 rcu_read_unlock();
1955 1956
@@ -1992,6 +1993,7 @@ static int nfs41_check_open_stateid(struct nfs4_state *state)
1992 return -NFS4ERR_BAD_STATEID; 1993 return -NFS4ERR_BAD_STATEID;
1993 1994
1994 status = nfs41_test_stateid(server, stateid, cred); 1995 status = nfs41_test_stateid(server, stateid, cred);
1996 trace_nfs4_test_open_stateid(state, NULL, status);
1995 if (status != NFS_OK) { 1997 if (status != NFS_OK) {
1996 /* Free the stateid unless the server explicitly 1998 /* Free the stateid unless the server explicitly
1997 * informs us the stateid is unrecognized. */ 1999 * informs us the stateid is unrecognized. */
@@ -5472,6 +5474,7 @@ static int nfs41_check_expired_locks(struct nfs4_state *state)
5472 status = nfs41_test_stateid(server, 5474 status = nfs41_test_stateid(server,
5473 &lsp->ls_stateid, 5475 &lsp->ls_stateid,
5474 cred); 5476 cred);
5477 trace_nfs4_test_lock_stateid(state, lsp, status);
5475 if (status != NFS_OK) { 5478 if (status != NFS_OK) {
5476 /* Free the stateid unless the server 5479 /* Free the stateid unless the server
5477 * informs us the stateid is unrecognized. */ 5480 * informs us the stateid is unrecognized. */
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index 05b96a6dac5c..849cf146db30 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -638,6 +638,55 @@ TRACE_EVENT(nfs4_delegreturn_exit,
638 ) 638 )
639); 639);
640 640
641#ifdef CONFIG_NFS_V4_1
642DECLARE_EVENT_CLASS(nfs4_test_stateid_event,
643 TP_PROTO(
644 const struct nfs4_state *state,
645 const struct nfs4_lock_state *lsp,
646 int error
647 ),
648
649 TP_ARGS(state, lsp, error),
650
651 TP_STRUCT__entry(
652 __field(int, error)
653 __field(dev_t, dev)
654 __field(u32, fhandle)
655 __field(u64, fileid)
656 ),
657
658 TP_fast_assign(
659 const struct inode *inode = state->inode;
660
661 __entry->error = error;
662 __entry->dev = inode->i_sb->s_dev;
663 __entry->fileid = NFS_FILEID(inode);
664 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
665 ),
666
667 TP_printk(
668 "error=%d (%s) fileid=%02x:%02x:%llu fhandle=0x%08x",
669 __entry->error,
670 show_nfsv4_errors(__entry->error),
671 MAJOR(__entry->dev), MINOR(__entry->dev),
672 (unsigned long long)__entry->fileid,
673 __entry->fhandle
674 )
675);
676
677#define DEFINE_NFS4_TEST_STATEID_EVENT(name) \
678 DEFINE_EVENT(nfs4_test_stateid_event, name, \
679 TP_PROTO( \
680 const struct nfs4_state *state, \
681 const struct nfs4_lock_state *lsp, \
682 int error \
683 ), \
684 TP_ARGS(state, lsp, error))
685DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_delegation_stateid);
686DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_open_stateid);
687DEFINE_NFS4_TEST_STATEID_EVENT(nfs4_test_lock_stateid);
688#endif /* CONFIG_NFS_V4_1 */
689
641DECLARE_EVENT_CLASS(nfs4_lookup_event, 690DECLARE_EVENT_CLASS(nfs4_lookup_event,
642 TP_PROTO( 691 TP_PROTO(
643 const struct inode *dir, 692 const struct inode *dir,