* [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
@ 2025-12-19 17:59 Olga Kornievskaia
2025-12-19 18:04 ` Jeff Layton
2025-12-19 19:21 ` Chuck Lever
0 siblings, 2 replies; 3+ messages in thread
From: Olga Kornievskaia @ 2025-12-19 17:59 UTC (permalink / raw)
To: chuck.lever, jlayton; +Cc: linux-nfs, neilb, Dai.Ngo, tom
fstests generic/215 and generic/407 were failing because the server
wasn't updating mtime properly. When deleg attribute support is not
compiled in and thus no attribute delegation was given, the server
was skipping updating mtime and ctime because FMODE_NOCMTIME was
uncoditionally set for the write delegation.
Fixes: e5e9b24ab8fa ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
---
fs/nfsd/nfs4state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 808c24fb5c9a..d64650c47f79 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -6327,7 +6327,8 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open,
dp->dl_ctime = stat.ctime;
dp->dl_mtime = stat.mtime;
spin_lock(&f->f_lock);
- f->f_mode |= FMODE_NOCMTIME;
+ if (deleg_ts)
+ f->f_mode |= FMODE_NOCMTIME;
spin_unlock(&f->f_lock);
trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);
} else {
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
2025-12-19 17:59 [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Olga Kornievskaia
@ 2025-12-19 18:04 ` Jeff Layton
2025-12-19 19:21 ` Chuck Lever
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Layton @ 2025-12-19 18:04 UTC (permalink / raw)
To: Olga Kornievskaia, chuck.lever; +Cc: linux-nfs, neilb, Dai.Ngo, tom
On Fri, 2025-12-19 at 12:59 -0500, Olga Kornievskaia wrote:
> fstests generic/215 and generic/407 were failing because the server
> wasn't updating mtime properly. When deleg attribute support is not
> compiled in and thus no attribute delegation was given, the server
> was skipping updating mtime and ctime because FMODE_NOCMTIME was
> uncoditionally set for the write delegation.
>
> Fixes: e5e9b24ab8fa ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation")
> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> ---
> fs/nfsd/nfs4state.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 808c24fb5c9a..d64650c47f79 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -6327,7 +6327,8 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open,
> dp->dl_ctime = stat.ctime;
> dp->dl_mtime = stat.mtime;
> spin_lock(&f->f_lock);
> - f->f_mode |= FMODE_NOCMTIME;
> + if (deleg_ts)
> + f->f_mode |= FMODE_NOCMTIME;
> spin_unlock(&f->f_lock);
> trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);
> } else {
Nice catch.
We only want to disable c/mtime updates in the case where timestamps
are delegated. In the non-delegated case, they need to be updated with
every write. This seems correct to me.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
2025-12-19 17:59 [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Olga Kornievskaia
2025-12-19 18:04 ` Jeff Layton
@ 2025-12-19 19:21 ` Chuck Lever
1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2025-12-19 19:21 UTC (permalink / raw)
To: jlayton, Olga Kornievskaia; +Cc: Chuck Lever, linux-nfs, neilb, Dai.Ngo, tom
From: Chuck Lever <chuck.lever@oracle.com>
On Fri, 19 Dec 2025 12:59:55 -0500, Olga Kornievskaia wrote:
> fstests generic/215 and generic/407 were failing because the server
> wasn't updating mtime properly. When deleg attribute support is not
> compiled in and thus no attribute delegation was given, the server
> was skipping updating mtime and ctime because FMODE_NOCMTIME was
> uncoditionally set for the write delegation.
>
>
> [...]
Applied to nfsd-testing, thanks!
[1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
commit: ad8ac894d0d9797f557cbf51c05fd32830887d9c
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-19 19:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 17:59 [PATCH 1/1] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Olga Kornievskaia
2025-12-19 18:04 ` Jeff Layton
2025-12-19 19:21 ` Chuck Lever
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.