Skip to contentSkip to conversation

NFSD: Fix nfsd_clid_class use of __string_len() macro

PATCH In review Steven Rostedt 2 participants 3 messages Feb 22, 2024

Subsystems (3)
lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 NFSD: Fix nfsd_clid_class use of __string_len() macro

From: "Steven Rostedt (Google)" <[email protected]>

I'm working on restructuring the __string* macros so that it doesn't need to recalculate the string twice. That is, it will save it off when processing __string() and the __assign_str() will not need to do the work again as it currently does.

Currently __string_len(item, src, len) doesn't actually use "src", but my changes will require src to be correct as that is where the __assign_str() will get its value from.

The event class nfsd_clid_class has:

__string_len(name, name, clp->cl_name.len)

But the second "name" does not exist and causes my changes to fail to build. That second parameter should be: clp->cl_name.data.

Fixes d27b74a8675ca ("NFSD: Use new __string_len C macros for nfsd_clid_class")
---
 fs/nfsd/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/trace.h +1 -1
index d1e8cf079b0f..2cd57033791f 100644
@@ -843,7 +843,7 @@ DECLARE_EVENT_CLASS(nfsd_clid_class,
 		__array(unsigned char, addr, sizeof(struct sockaddr_in6))
 		__field(unsigned long, flavor)
 		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
-		__string_len(name, name, clp->cl_name.len)
+		__string_len(name, clp->cl_name.data, clp->cl_name.len)
 	),
 	TP_fast_assign(
 		__entry->cl_boot = clp->cl_clientid.cl_boot;
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 40 lines · Steven Rostedt

From: "Steven Rostedt (Google)" <[email protected]>

I'm working on restructuring the __string* macros so that it doesn't need to recalculate the string twice. That is, it will save it off when processing __string() and the __assign_str() will not need to do the work again as it currently does.

Currently __string_len(item, src, len) doesn't actually use "src", but my changes will require src to be correct as that is where the __assign_str() will get its value from.

The event class nfsd_clid_class has:

__string_len(name, name, clp->cl_name.len)

But the second "name" does not exist and causes my changes to fail to build. That second parameter should be: clp->cl_name.data.

Fixes d27b74a8675ca ("NFSD: Use new __string_len C macros for nfsd_clid_class")
---
 fs/nfsd/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/trace.h +1 -1
index d1e8cf079b0f..2cd57033791f 100644
@@ -843,7 +843,7 @@ DECLARE_EVENT_CLASS(nfsd_clid_class,
 		__array(unsigned char, addr, sizeof(struct sockaddr_in6))
 		__field(unsigned long, flavor)
 		__array(unsigned char, verifier, NFS4_VERIFIER_SIZE)
-		__string_len(name, name, clp->cl_name.len)
+		__string_len(name, clp->cl_name.data, clp->cl_name.len)
 	),
 	TP_fast_assign(
 		__entry->cl_boot = clp->cl_clientid.cl_boot;
Signature · 1 line
2.43.0

Do you want me to take this through the nfsd tree, or would you like an Ack from me so you can handle it as part of your clean up? Just in case:

Signature · 1 line
Chuck Lever
author maintainer
#2 lore raw
Quoted 6 lines · On Thu, 22 Feb 2024 13:25:34 -0500 Chuck Lever <[email protected]> wrote:

Do you want me to take this through the nfsd tree, or would you like an Ack from me so you can handle it as part of your clean up? Just in case:

As my patches depend on this, I can take it with your ack.

Thanks!

-- Steve