[PATCH 1/2] nfsd: Report vetted delegated timestamps in GETATTR replies
From: Jeff Layton
Date: Mon Nov 02 2026 - 15:39:55 EST
When a CB_GETATTR reply shows the file modified, nfsd4_encode_fattr4()
overrides atime and mtime with the raw time_deleg_access and
time_deleg_modify values from the reply. cb_getattr_update_times() has
already vetted those values per RFC 9754 section 5 and written the
result to the inode, so the override undoes that vetting:
- a time older than at delegation grant, which the server ignores, is
still reported to the querying client
- a time in the future is reported unclamped
vfs_getattr() runs after the update and already returns the vetted
times. Drop the override.
Fixes: 6ae30d6eb26b ("nfsd: add support for delegated timestamps")
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
fs/nfsd/nfs4xdr.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 90b44163f886..434b6cfc5741 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -4098,14 +4098,8 @@ nfsd4_encode_fattr4(struct svc_rqst *rqstp, struct xdr_stream *xdr,
if (ncf->ncf_file_modified) {
++ncf->ncf_initial_cinfo;
args.stat.size = ncf->ncf_cur_fsize;
- if (!timespec64_is_epoch(&ncf->ncf_cb_mtime))
- args.stat.mtime = ncf->ncf_cb_mtime;
}
args.change_attr = ncf->ncf_initial_cinfo;
-
- if (!timespec64_is_epoch(&ncf->ncf_cb_atime))
- args.stat.atime = ncf->ncf_cb_atime;
-
nfs4_put_stid(&dp->dl_stid);
} else {
args.change_attr = nfsd4_change_attribute(&args.stat);
--
2.56.0