* [PATCH v2 0/2] nfsd: move delegated timestamps to being runtime disabled instead of compile time
@ 2026-01-25 12:24 Jeff Layton
2026-01-25 12:24 ` [PATCH v2 1/2] nfsd: add a runtime switch for disabling delegated timestamps Jeff Layton
2026-01-25 12:24 ` [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option Jeff Layton
0 siblings, 2 replies; 5+ messages in thread
From: Jeff Layton @ 2026-01-25 12:24 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, linux-kernel, Jeff Layton
Small update: The kernel test robot reported that this didn't build when
CONFIG_NFSD_V4 was disabled. The fix is to compile out the new debugfs
file when that's the case. Resending both patches, but the second patch
is identical.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- Don't create debugfs file when CONFIG_NFSD_V4 is disabled
- Link to v1: https://lore.kernel.org/r/20260122-delegts-v1-0-40fbb180556c@kernel.org
---
Jeff Layton (2):
nfsd: add a runtime switch for disabling delegated timestamps
nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option
fs/nfsd/Kconfig | 10 ----------
fs/nfsd/debugfs.c | 4 ++++
fs/nfsd/nfs4state.c | 11 ++++-------
fs/nfsd/nfsd.h | 1 +
4 files changed, 9 insertions(+), 17 deletions(-)
---
base-commit: 2a1dde6dd823e94e0768e929566dd65cd74ca793
change-id: 20260122-delegts-150060ac7c9a
Best regards,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] nfsd: add a runtime switch for disabling delegated timestamps
2026-01-25 12:24 [PATCH v2 0/2] nfsd: move delegated timestamps to being runtime disabled instead of compile time Jeff Layton
@ 2026-01-25 12:24 ` Jeff Layton
2026-01-25 12:24 ` [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option Jeff Layton
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2026-01-25 12:24 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, linux-kernel, Jeff Layton
The delegated timestamp code seems to be working well enough now that we
want to make it always be built in. In the event that there are problems
though, we still want to be able to disable them for debugging purposes.
Add a switch to debugfs to enable them at runtime.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/nfsd/debugfs.c | 4 ++++
fs/nfsd/nfs4state.c | 4 ++++
fs/nfsd/nfsd.h | 1 +
3 files changed, 9 insertions(+)
diff --git a/fs/nfsd/debugfs.c b/fs/nfsd/debugfs.c
index 7f44689e0a53edbfd6ade9dda6af4052976a65d3..386fd1c54f5277fd9b9544caa5220e234915264d 100644
--- a/fs/nfsd/debugfs.c
+++ b/fs/nfsd/debugfs.c
@@ -140,4 +140,8 @@ void nfsd_debugfs_init(void)
debugfs_create_file("io_cache_write", 0644, nfsd_top_dir, NULL,
&nfsd_io_cache_write_fops);
+#ifdef CONFIG_NFSD_V4
+ debugfs_create_bool("delegated_timestamps", 0644, nfsd_top_dir,
+ &nfsd_delegts_enabled);
+#endif
}
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 583c13b5aaf3cd12a87c7aae62fe6a8223368f55..95f2e87141a7ab5dd3da6741859bdcae28a8c6c0 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -76,6 +76,8 @@ static const stateid_t close_stateid = {
static u64 current_sessionid = 1;
+bool nfsd_delegts_enabled __read_mostly = true;
+
#define ZERO_STATEID(stateid) (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
#define ONE_STATEID(stateid) (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
#define CURRENT_STATEID(stateid) (!memcmp((stateid), ¤tstateid, sizeof(stateid_t)))
@@ -6048,6 +6050,8 @@ nfsd4_verify_setuid_write(struct nfsd4_open *open, struct nfsd_file *nf)
#ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS
static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
{
+ if (!nfsd_delegts_enabled)
+ return false;
return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
}
#else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index a2e35a4fa105380c2d99cb0865003e0f7f4a8e8d..7c009f07c90b50d7074695d4665a2eca85140eda 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -160,6 +160,7 @@ static inline void nfsd_debugfs_exit(void) {}
#endif
extern bool nfsd_disable_splice_read __read_mostly;
+extern bool nfsd_delegts_enabled __read_mostly;
enum {
/* Any new NFSD_IO enum value must be added at the end */
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option
2026-01-25 12:24 [PATCH v2 0/2] nfsd: move delegated timestamps to being runtime disabled instead of compile time Jeff Layton
2026-01-25 12:24 ` [PATCH v2 1/2] nfsd: add a runtime switch for disabling delegated timestamps Jeff Layton
@ 2026-01-25 12:24 ` Jeff Layton
2026-01-25 16:43 ` Chuck Lever
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2026-01-25 12:24 UTC (permalink / raw)
To: Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey
Cc: linux-nfs, linux-kernel, Jeff Layton
Now that there is a runtime debugfs switch, eliminate the compile-time
switch and always build in support for delegated timestamps.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/nfsd/Kconfig | 10 ----------
fs/nfsd/nfs4state.c | 7 -------
2 files changed, 17 deletions(-)
diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index 4fd6e818565ea24e4e16844a3f82e808dbc558f8..fc0e87eaa25714d621aa893c99dabe4ce34228df 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -177,16 +177,6 @@ config NFSD_LEGACY_CLIENT_TRACKING
and will be removed in the future. Say Y here if you need support
for them in the interim.
-config NFSD_V4_DELEG_TIMESTAMPS
- bool "Support delegated timestamps"
- depends on NFSD_V4
- default n
- help
- NFSD implements delegated timestamps according to
- draft-ietf-nfsv4-delstid-08 "Extending the Opening of Files". This
- is currently an experimental feature and is therefore left disabled
- by default.
-
config NFSD_V4_POSIX_ACLS
bool "Support NFSv4 POSIX draft ACLs"
depends on NFSD_V4
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 95f2e87141a7ab5dd3da6741859bdcae28a8c6c0..e2f29ba490c6335e2cb6c3a411770b3a19755095 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -6047,19 +6047,12 @@ nfsd4_verify_setuid_write(struct nfsd4_open *open, struct nfsd_file *nf)
return 0;
}
-#ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS
static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
{
if (!nfsd_delegts_enabled)
return false;
return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
}
-#else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
-static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
-{
- return false;
-}
-#endif /* CONFIG NFSD_V4_DELEG_TIMESTAMPS */
static struct nfs4_delegation *
nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option
2026-01-25 12:24 ` [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option Jeff Layton
@ 2026-01-25 16:43 ` Chuck Lever
2026-01-25 22:01 ` Jeff Layton
0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever @ 2026-01-25 16:43 UTC (permalink / raw)
To: Jeff Layton, Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo,
Tom Talpey
Cc: linux-nfs, linux-kernel
On Sun, Jan 25, 2026, at 7:24 AM, Jeff Layton wrote:
> Now that there is a runtime debugfs switch, eliminate the compile-time
> switch and always build in support for delegated timestamps.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/nfsd/Kconfig | 10 ----------
> fs/nfsd/nfs4state.c | 7 -------
> 2 files changed, 17 deletions(-)
>
> diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> index
> 4fd6e818565ea24e4e16844a3f82e808dbc558f8..fc0e87eaa25714d621aa893c99dabe4ce34228df
> 100644
> --- a/fs/nfsd/Kconfig
> +++ b/fs/nfsd/Kconfig
> @@ -177,16 +177,6 @@ config NFSD_LEGACY_CLIENT_TRACKING
> and will be removed in the future. Say Y here if you need support
> for them in the interim.
>
> -config NFSD_V4_DELEG_TIMESTAMPS
> - bool "Support delegated timestamps"
> - depends on NFSD_V4
> - default n
> - help
> - NFSD implements delegated timestamps according to
> - draft-ietf-nfsv4-delstid-08 "Extending the Opening of Files". This
> - is currently an experimental feature and is therefore left disabled
> - by default.
> -
> config NFSD_V4_POSIX_ACLS
> bool "Support NFSv4 POSIX draft ACLs"
> depends on NFSD_V4
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index
> 95f2e87141a7ab5dd3da6741859bdcae28a8c6c0..e2f29ba490c6335e2cb6c3a411770b3a19755095
> 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -6047,19 +6047,12 @@ nfsd4_verify_setuid_write(struct nfsd4_open
> *open, struct nfsd_file *nf)
> return 0;
> }
>
> -#ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS
> static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
> {
> if (!nfsd_delegts_enabled)
> return false;
> return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
> }
> -#else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
> -static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
> -{
> - return false;
> -}
> -#endif /* CONFIG NFSD_V4_DELEG_TIMESTAMPS */
>
> static struct nfs4_delegation *
> nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
>
> --
> 2.52.0
Thanks for jumping on the robot report.
This time around, LLM review produced some comments related to
documentation that seem pretty sensible to me, so I'm passing
these along verbatim:
Key Concerns:
1. Behavioral change: Systems that previously disabled this experimental feature at compile-time will now have it enabled by default after upgrade. While the runtime switch allows disabling, administrators are not informed of this change.
2. Documentation gap: The commit message is minimal and doesn't explain the transition rationale, migration path, or the loss of the RFC specification reference that was in the Kconfig help text.
[ cel: Perhaps some of the context provided in the cover letter
is not visible to the LLM -- but note, that context won't appear
in the commit history either ]
Recommendations:
1. Consider whether nfsd_delegts_enabled should default to false to preserve the conservative default of the removed Kconfig option, or document the intentional policy shift
2. Expand commit message to include migration guidance:
Administrators who previously disabled this feature at compile time can disable it at runtime via:
echo 0 > /sys/kernel/debug/nfsd/delegated_timestamps
3. Add a brief comment above nfsd4_want_deleg_timestamps() documenting the debugfs control and RFC reference
As the new debugfs switch is intended to be undocumented and
temporary, I think adding some code comments and a little more
beef to the commit message (sorry vegans) would be helpful. You
don't need to go crazy with it.
--
Chuck Lever
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option
2026-01-25 16:43 ` Chuck Lever
@ 2026-01-25 22:01 ` Jeff Layton
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2026-01-25 22:01 UTC (permalink / raw)
To: Chuck Lever, Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo,
Tom Talpey
Cc: linux-nfs, linux-kernel
On Sun, 2026-01-25 at 11:43 -0500, Chuck Lever wrote:
>
> On Sun, Jan 25, 2026, at 7:24 AM, Jeff Layton wrote:
> > Now that there is a runtime debugfs switch, eliminate the compile-time
> > switch and always build in support for delegated timestamps.
> >
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> > fs/nfsd/Kconfig | 10 ----------
> > fs/nfsd/nfs4state.c | 7 -------
> > 2 files changed, 17 deletions(-)
> >
> > diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
> > index
> > 4fd6e818565ea24e4e16844a3f82e808dbc558f8..fc0e87eaa25714d621aa893c99dabe4ce34228df
> > 100644
> > --- a/fs/nfsd/Kconfig
> > +++ b/fs/nfsd/Kconfig
> > @@ -177,16 +177,6 @@ config NFSD_LEGACY_CLIENT_TRACKING
> > and will be removed in the future. Say Y here if you need support
> > for them in the interim.
> >
> > -config NFSD_V4_DELEG_TIMESTAMPS
> > - bool "Support delegated timestamps"
> > - depends on NFSD_V4
> > - default n
> > - help
> > - NFSD implements delegated timestamps according to
> > - draft-ietf-nfsv4-delstid-08 "Extending the Opening of Files". This
> > - is currently an experimental feature and is therefore left disabled
> > - by default.
> > -
> > config NFSD_V4_POSIX_ACLS
> > bool "Support NFSv4 POSIX draft ACLs"
> > depends on NFSD_V4
> > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> > index
> > 95f2e87141a7ab5dd3da6741859bdcae28a8c6c0..e2f29ba490c6335e2cb6c3a411770b3a19755095
> > 100644
> > --- a/fs/nfsd/nfs4state.c
> > +++ b/fs/nfsd/nfs4state.c
> > @@ -6047,19 +6047,12 @@ nfsd4_verify_setuid_write(struct nfsd4_open
> > *open, struct nfsd_file *nf)
> > return 0;
> > }
> >
> > -#ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS
> > static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
> > {
> > if (!nfsd_delegts_enabled)
> > return false;
> > return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
> > }
> > -#else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
> > -static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
> > -{
> > - return false;
> > -}
> > -#endif /* CONFIG NFSD_V4_DELEG_TIMESTAMPS */
> >
> > static struct nfs4_delegation *
> > nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
> >
> > --
> > 2.52.0
>
> Thanks for jumping on the robot report.
>
> This time around, LLM review produced some comments related to
> documentation that seem pretty sensible to me, so I'm passing
> these along verbatim:
>
> Key Concerns:
>
> 1. Behavioral change: Systems that previously disabled this experimental feature at compile-time will now have it enabled by default after upgrade. While the runtime switch allows disabling, administrators are not informed of this change.
> 2. Documentation gap: The commit message is minimal and doesn't explain the transition rationale, migration path, or the loss of the RFC specification reference that was in the Kconfig help text.
>
> [ cel: Perhaps some of the context provided in the cover letter
> is not visible to the LLM -- but note, that context won't appear
> in the commit history either ]
>
> Recommendations:
>
> 1. Consider whether nfsd_delegts_enabled should default to false to preserve the conservative default of the removed Kconfig option, or document the intentional policy shift
> 2. Expand commit message to include migration guidance:
> Administrators who previously disabled this feature at compile time can disable it at runtime via:
> echo 0 > /sys/kernel/debug/nfsd/delegated_timestamps
>
>
> 3. Add a brief comment above nfsd4_want_deleg_timestamps() documenting the debugfs control and RFC reference
>
>
> As the new debugfs switch is intended to be undocumented and
> temporary, I think adding some code comments and a little more
> beef to the commit message (sorry vegans) would be helpful. You
> don't need to go crazy with it.
>
Sounds good. I'll plan to send a v3.
Thanks,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-25 22:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-25 12:24 [PATCH v2 0/2] nfsd: move delegated timestamps to being runtime disabled instead of compile time Jeff Layton
2026-01-25 12:24 ` [PATCH v2 1/2] nfsd: add a runtime switch for disabling delegated timestamps Jeff Layton
2026-01-25 12:24 ` [PATCH v2 2/2] nfsd: remove NFSD_V4_DELEG_TIMESTAMPS Kconfig option Jeff Layton
2026-01-25 16:43 ` Chuck Lever
2026-01-25 22:01 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox