Commit 3944369d authored by Anna Schumaker's avatar Anna Schumaker

NFS: Avoid RCU usage in tracepoints

There isn't an obvious way to acquire and release the RCU lock during a
tracepoint, so we can't use the rpc_peeraddr2str() function here.
Instead, rely on the client's cl_hostname, which should have similar
enough information without needing an rcu_dereference().
Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
Cc: stable@vger.kernel.org # v3.12
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 62b56a67
...@@ -201,17 +201,13 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event, ...@@ -201,17 +201,13 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event,
TP_ARGS(clp, error), TP_ARGS(clp, error),
TP_STRUCT__entry( TP_STRUCT__entry(
__string(dstaddr, __string(dstaddr, clp->cl_hostname)
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR))
__field(int, error) __field(int, error)
), ),
TP_fast_assign( TP_fast_assign(
__entry->error = error; __entry->error = error;
__assign_str(dstaddr, __assign_str(dstaddr, clp->cl_hostname);
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR));
), ),
TP_printk( TP_printk(
...@@ -1132,9 +1128,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event, ...@@ -1132,9 +1128,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event,
__field(dev_t, dev) __field(dev_t, dev)
__field(u32, fhandle) __field(u32, fhandle)
__field(u64, fileid) __field(u64, fileid)
__string(dstaddr, clp ? __string(dstaddr, clp ? clp->cl_hostname : "unknown")
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR) : "unknown")
), ),
TP_fast_assign( TP_fast_assign(
...@@ -1147,9 +1141,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event, ...@@ -1147,9 +1141,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event,
__entry->fileid = 0; __entry->fileid = 0;
__entry->dev = 0; __entry->dev = 0;
} }
__assign_str(dstaddr, clp ? __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown")
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR) : "unknown")
), ),
TP_printk( TP_printk(
...@@ -1191,9 +1183,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, ...@@ -1191,9 +1183,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event,
__field(dev_t, dev) __field(dev_t, dev)
__field(u32, fhandle) __field(u32, fhandle)
__field(u64, fileid) __field(u64, fileid)
__string(dstaddr, clp ? __string(dstaddr, clp ? clp->cl_hostname : "unknown")
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR) : "unknown")
__field(int, stateid_seq) __field(int, stateid_seq)
__field(u32, stateid_hash) __field(u32, stateid_hash)
), ),
...@@ -1208,9 +1198,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, ...@@ -1208,9 +1198,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event,
__entry->fileid = 0; __entry->fileid = 0;
__entry->dev = 0; __entry->dev = 0;
} }
__assign_str(dstaddr, clp ? __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown")
rpc_peeraddr2str(clp->cl_rpcclient,
RPC_DISPLAY_ADDR) : "unknown")
__entry->stateid_seq = __entry->stateid_seq =
be32_to_cpu(stateid->seqid); be32_to_cpu(stateid->seqid);
__entry->stateid_hash = __entry->stateid_hash =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment