NFSD: Add a Kconfig setting to enable delegated timestamps
authorChuck Lever <chuck.lever@oracle.com>
Wed, 12 Mar 2025 03:06:38 +0000 (23:06 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 14 Mar 2025 14:49:47 +0000 (10:49 -0400)
After three tries, we still see test failures with delegated
timestamps. Disable them by default, but leave the implementation
intact so that development can continue.

Cc: stable@vger.kernel.org # v6.14
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/Kconfig
fs/nfsd/nfs4state.c

index c0bd1509ccd48060406c78008260e62647ed953a..792d3fed1b45fd131e6d2890c352150b72cb4851 100644 (file)
@@ -172,6 +172,16 @@ config NFSD_LEGACY_CLIENT_TRACKING
          recoverydir, or spawn a process directly using a usermodehelper
          upcall.
 
-         These legacy client tracking methods have proven to be probelmatic
+         These legacy client tracking methods have proven to be problematic
          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.
index 982045944c3cc316b34f61014dcc175478ed2113..2041268b398a4ebff8c3010bda4637798342225b 100644 (file)
@@ -5956,11 +5956,23 @@ 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)
+{
+       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,
                    struct svc_fh *parent)
 {
-       bool deleg_ts = open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
+       bool deleg_ts = nfsd4_want_deleg_timestamps(open);
        struct nfs4_client *clp = stp->st_stid.sc_client;
        struct nfs4_file *fp = stp->st_stid.sc_file;
        struct nfs4_clnt_odstate *odstate = stp->st_clnt_odstate;
@@ -6168,8 +6180,8 @@ static void
 nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
                     struct svc_fh *currentfh)
 {
-       bool deleg_ts = open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
        struct nfs4_openowner *oo = openowner(stp->st_stateowner);
+       bool deleg_ts = nfsd4_want_deleg_timestamps(open);
        struct nfs4_client *clp = stp->st_stid.sc_client;
        struct svc_fh *parent = NULL;
        struct nfs4_delegation *dp;