Skip to contentSkip to conversation

NFS: add a tracepoint for uniquifier of fscache

PATCH In review Chen Hanxiao 2 participants 3 messages Mar 5, 2024 – Mar 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NFS: add a tracepoint for uniquifier of fscache

Add a tracepoint to the mount fsc=xxx option

---
 fs/nfs/fs_context.c | 3 +++
 1 file changed, 3 insertions(+)
fs/nfs/fs_context.c +3 -0
index 853e8d609bb3..fd8813222cd2 100644
@@ -652,6 +652,9 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
 		ctx->fscache_uniq = NULL;
 		break;
 	case Opt_fscache:
+		if (!param->string)
+			goto out_invalid_value;
+		trace_nfs_mount_assign(param->key, param->string);
 		ctx->options |= NFS_OPTION_FSCACHE;
 		kfree(ctx->fscache_uniq);
 		ctx->fscache_uniq = param->string;
Signature · 1 line
2.39.1
#1 lore raw
Quoted 18 lines · Chen Hanxiao

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Add a tracepoint to the mount fsc=xxx option

---
 fs/nfs/fs_context.c | 3 +++

 1 file changed, 3 insertions(+)
fs/nfs/fs_context.c +0 -0
index 853e8d609bb3..fd8813222cd2 100644
@@ -652,6 +652,9 @@ static int nfs_fs_context_parse_param(struct
 fs_context *fc,
                 ctx->fscache_uniq = NULL;
                 break;
Quoted 4 lines

        case Opt_fscache:
+               if (!param->string)
+                       goto out_invalid_value;
+               trace_nfs_mount_assign(param->key, param->string);

The description does not match the contents of the patch. Why would we need that extra check on top of the ones made by fs_param_is_string()?

Quoted 6 lines

                ctx->options |= NFS_OPTION_FSCACHE; kfree(ctx->fscache_uniq); ctx->fscache_uniq = param->string; --
2.39.1

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, Hammerspace
[email protected]
#2 lore raw
Quoted 20 lines

-----邮件原件-----
发件人: Trond Myklebust <[email protected]>
发送时间: 2024年3月5日 23:28
收件人: [email protected];
抄送: [email protected]; [email protected]
主题: Re: [PATCH] NFS: add a tracepoint for uniquifier of fscache

Quoted 10 lines · Chen Hanxiao

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Add a tracepoint to the mount fsc=xxx option

---
 fs/nfs/fs_context.c | 3 +++

 1 file changed, 3 insertions(+)
Quoted 16 lines
Quoted 8 lines
fs/nfs/fs_context.c +0 -0
index 853e8d609bb3..fd8813222cd2 100644
@@ -652,6 +652,9 @@ static int nfs_fs_context_parse_param(struct
 fs_context *fc,
                 ctx->fscache_uniq = NULL;
                 break;
Quoted 4 lines

        case Opt_fscache:
+               if (!param->string)
+                       goto out_invalid_value;
+               trace_nfs_mount_assign(param->key, param->string);

The description does not match the contents of the patch. Why would we need that extra check on top of the ones made by fs_param_is_string()?

I take 5559405df652 ("nfs: fix possible null-ptr-deref when parsing param") for reference. Maybe I misunderstand that fix.
I'll post a v2 without the null check, and with a proper description about commit message.

Regards,
- Chen