]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.15/nfsd-fix-nfsd_clid_class-use-of-__string_len-macro.patch
6.6-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.15 / nfsd-fix-nfsd_clid_class-use-of-__string_len-macro.patch
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
5
6 From: Steven Rostedt (Google) <rostedt@goodmis.org>
7
8 [ Upstream commit 9388a2aa453321bcf1ad2603959debea9e6ab6d4 ]
9
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.
14
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.
18
19 The event class nfsd_clid_class has:
20
21 __string_len(name, name, clp->cl_name.len)
22
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.
25
26 Link: https://lore.kernel.org/linux-trace-kernel/20240222122828.3d8d213c@gandalf.local.home
27
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>
38 ---
39 fs/nfsd/trace.h | 2 +-
40 1 file changed, 1 insertion(+), 1 deletion(-)
41
42 diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
43 index 0fc1fa6f28e0b..7e7d0f1705ed3 100644
44 --- a/fs/nfsd/trace.h
45 +++ b/fs/nfsd/trace.h
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)
52 ),
53 TP_fast_assign(
54 __entry->cl_boot = clp->cl_clientid.cl_boot;
55 --
56 2.43.0
57