Skip to content

Commit 5f15a20

Browse files
chucklevergregkh
authored andcommitted
NFSD: Add a Kconfig setting to enable delegated timestamps
commit 26a8076 upstream. 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: [email protected] # v6.14 Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 133f5e2 commit 5f15a20

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

fs/nfsd/Kconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ config NFSD_LEGACY_CLIENT_TRACKING
172172
recoverydir, or spawn a process directly using a usermodehelper
173173
upcall.
174174

175-
These legacy client tracking methods have proven to be probelmatic
175+
These legacy client tracking methods have proven to be problematic
176176
and will be removed in the future. Say Y here if you need support
177177
for them in the interim.
178+
179+
config NFSD_V4_DELEG_TIMESTAMPS
180+
bool "Support delegated timestamps"
181+
depends on NFSD_V4
182+
default n
183+
help
184+
NFSD implements delegated timestamps according to
185+
draft-ietf-nfsv4-delstid-08 "Extending the Opening of Files". This
186+
is currently an experimental feature and is therefore left disabled
187+
by default.

fs/nfsd/nfs4state.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5958,11 +5958,23 @@ nfsd4_verify_setuid_write(struct nfsd4_open *open, struct nfsd_file *nf)
59585958
return 0;
59595959
}
59605960

5961+
#ifdef CONFIG_NFSD_V4_DELEG_TIMESTAMPS
5962+
static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
5963+
{
5964+
return open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
5965+
}
5966+
#else /* CONFIG_NFSD_V4_DELEG_TIMESTAMPS */
5967+
static bool nfsd4_want_deleg_timestamps(const struct nfsd4_open *open)
5968+
{
5969+
return false;
5970+
}
5971+
#endif /* CONFIG NFSD_V4_DELEG_TIMESTAMPS */
5972+
59615973
static struct nfs4_delegation *
59625974
nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
59635975
struct svc_fh *parent)
59645976
{
5965-
bool deleg_ts = open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
5977+
bool deleg_ts = nfsd4_want_deleg_timestamps(open);
59665978
struct nfs4_client *clp = stp->st_stid.sc_client;
59675979
struct nfs4_file *fp = stp->st_stid.sc_file;
59685980
struct nfs4_clnt_odstate *odstate = stp->st_clnt_odstate;
@@ -6161,8 +6173,8 @@ static void
61616173
nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
61626174
struct svc_fh *currentfh)
61636175
{
6164-
bool deleg_ts = open->op_deleg_want & OPEN4_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS;
61656176
struct nfs4_openowner *oo = openowner(stp->st_stateowner);
6177+
bool deleg_ts = nfsd4_want_deleg_timestamps(open);
61666178
struct nfs4_client *clp = stp->st_stid.sc_client;
61676179
struct svc_fh *parent = NULL;
61686180
struct nfs4_delegation *dp;

0 commit comments

Comments
 (0)