]> git.hungrycats.org Git - linux/commitdiff
NFS: Avoid RCU usage in tracepoints
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 1 Nov 2017 19:48:43 +0000 (15:48 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:42:24 +0000 (18:42 +0000)
commit 3944369db701f075092357b511fd9f5755771585 upstream.

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: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
[bwh: Backported to 3.16: Drop changes in
 nfs4_inode{,_stateid}_callback_event()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/nfs4trace.h

index 1c32adbe728df548bcc92ee175b4d6061b3b4489..14e589195caeaebf67e701178d2c4edae3217c79 100644 (file)
@@ -201,17 +201,13 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event,
                TP_ARGS(clp, error),
 
                TP_STRUCT__entry(
-                       __string(dstaddr,
-                               rpc_peeraddr2str(clp->cl_rpcclient,
-                                       RPC_DISPLAY_ADDR))
+                       __string(dstaddr, clp->cl_hostname)
                        __field(int, error)
                ),
 
                TP_fast_assign(
                        __entry->error = error;
-                       __assign_str(dstaddr,
-                               rpc_peeraddr2str(clp->cl_rpcclient,
-                                               RPC_DISPLAY_ADDR));
+                       __assign_str(dstaddr, clp->cl_hostname);
                ),
 
                TP_printk(