Re: [RFC PATCH v4 07/10] nfsd: add provenance time (ptime) via FATTR4_TIME_CREATE
From: Amir Goldstein
Date: Wed Nov 18 2026 - 02:44:20 EST
On Tue, Nov 17, 2026 at 11:02 PM Chuck Lever <cel@xxxxxxxxxx> wrote:
>
>
>
> 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.
In other words, for some server filesystems FATTR4_TIME_CREATE is
settable and for others it is not.
Isn't the NFSv4 protocol equipt to deal with this complexity?
>
> Essentially this changes the semantics of existing files that have
> a btime set -- technically that's a regression.
I fail to see in what situation this is a regression. Please explain.
The only oddity I can see is that a kernel downgrade could result
in an NFS client's view of FATTR4_TIME_CREATE going backward
in time to birth time, but I don't think this qualifies as a regression.
Thanks,
Amir.