1 From dc4da6ff6cbca1c0c4b22a3f2e054c88e2aa8750 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Thu, 22 Feb 2024 12:28:28 -0500
4 Subject: NFSD: Fix nfsd_clid_class use of __string_len() macro
6 From: Steven Rostedt (Google) <rostedt@goodmis.org>
8 [ Upstream commit 9388a2aa453321bcf1ad2603959debea9e6ab6d4 ]
10 I'm working on restructuring the __string* macros so that it doesn't need
11 to recalculate the string twice. That is, it will save it off when
12 processing __string() and the __assign_str() will not need to do the work
13 again as it currently does.
15 Currently __string_len(item, src, len) doesn't actually use "src", but my
16 changes will require src to be correct as that is where the __assign_str()
17 will get its value from.
19 The event class nfsd_clid_class has:
21 __string_len(name, name, clp->cl_name.len)
23 But the second "name" does not exist and causes my changes to fail to
24 build. That second parameter should be: clp->cl_name.data.
26 Link: https://lore.kernel.org/linux-trace-kernel/20240222122828.3d8d213c@gandalf.local.home
28 Cc: Neil Brown <neilb@suse.de>
29 Cc: Olga Kornievskaia <kolga@netapp.com>
30 Cc: Dai Ngo <Dai.Ngo@oracle.com>
31 Cc: Tom Talpey <tom@talpey.com>
32 Cc: stable@vger.kernel.org
33 Fixes: d27b74a8675ca ("NFSD: Use new __string_len C macros for nfsd_clid_class")
34 Acked-by: Chuck Lever <chuck.lever@oracle.com>
35 Acked-by: Jeff Layton <jlayton@kernel.org>
36 Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
37 Signed-off-by: Sasha Levin <sashal@kernel.org>
39 fs/nfsd/trace.h | 2 +-
40 1 file changed, 1 insertion(+), 1 deletion(-)
42 diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
43 index 0fc1fa6f28e0b..7e7d0f1705ed3 100644
46 @@ -606,7 +606,7 @@ DECLARE_EVENT_CLASS(nfsd_clid_class,
47 __array(unsigned char, addr, sizeof(struct sockaddr_in6))
48 __field(unsigned long, flavor)
49 __array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
50 - __string_len(name, name, clp->cl_name.len)
51 + __string_len(name, clp->cl_name.data, clp->cl_name.len)
54 __entry->cl_boot = clp->cl_clientid.cl_boot;