Re: [RFC PATCH v4 07/10] nfsd: add provenance time (ptime) via FATTR4_TIME_CREATE
From: Chuck Lever
Date: Tue Nov 17 2026 - 17:02:18 EST
On Sun, Nov 15, 2026, at 1:03 PM, koraynilay wrote:
> Implement provenance time (ptime) in NFSD, as introduced in a
> previous commit ("vfs: add provenance time (ptime)").
>
> Map ptime to FATTR4_TIME_CREATE, allowing clients to set it across
> CREATE, OPEN and SETATTR compounds.
>
> If the underlying filesystem supports it, use __vfs_fileattr_set_locked()
> to set it, returning -EOPNOTSUPP in case it's not supported (i.e. when
> __vfs_fileattr_set_locked() returns -ENOIOCTLCMD).
>
> When querying FATTR4_TIME_CREATE, request both STATX_PTIME and
> STATX_BTIME, preferring ptime over btime if available, and advertise
> FATTR4_TIME_CREATE support if either ptime or btime is available.
>
> Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.7
> Signed-off-by: koraynilay <koray.fra@xxxxxxxxx>
> @@ -3646,7 +3649,14 @@ static __be32
> nfsd4_encode_fattr4_time_access(struct xdr_stream *xdr,
> static __be32 nfsd4_encode_fattr4_time_create(struct xdr_stream *xdr,
> const struct nfsd4_fattr_args *args)
> {
> - return nfsd4_encode_nfstime4(xdr, &args->stat.btime);
> + const struct timespec64 *ts;
> +
> + if (args->stat.result_mask & STATX_PTIME)
> + ts = &args->stat.ptime;
> + else
> + ts = &args->stat.btime;
> +
> + return nfsd4_encode_nfstime4(xdr, ts);
> }
I have trouble with this approach.
We've already established that, for the Linux in-kernel NFS server
implementation, FATTR4_TIME_CREATE reports a file's birth time and
does not permit NFS clients to modify that.
After this patch is applied, the server reports the ptime instead
of the btime on some filesystems but not others.
Essentially this changes the semantics of existing files that have
a btime set -- technically that's a regression.
--
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)