RE: [PATCH 0/8] Support btime and other NFSv4 specific attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks like this should do I guess...

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 5a93a5db4fb0..be47e1dd6da5 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3265,6 +3265,14 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
                p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec);
                *p++ = cpu_to_be32(stat.mtime.tv_nsec);
        }
+       /* support for btime here */
+        if (bmval1 & FATTR4_WORD1_TIME_CREATE) {
+                p = xdr_reserve_space(xdr, 12);
+                if (!p)
+                        goto out_resource;
+                p = xdr_encode_hyper(p, (s64)stat.btime.tv_sec);
+                *p++ = cpu_to_be32(stat.btime.tv_nsec);
+        }
        if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) {
                struct kstat parent_stat;
                u64 ino = stat.ino;



-----Original Message-----
From: bfields@xxxxxxxxxxxx <bfields@xxxxxxxxxxxx>
Sent: středa 5. ledna 2022 16:55
To: Ondrej Valousek <ondrej.valousek.xm@xxxxxxxxxxx>
Cc: Trond Myklebust <trondmy@xxxxxxxxxxxxxxx>; trondmy@xxxxxxxxxx; linux-nfs@xxxxxxxxxxxxxxx; anna.schumaker@xxxxxxxxxx
Subject: Re: [PATCH 0/8] Support btime and other NFSv4 specific attributes

On Wed, Jan 05, 2022 at 03:40:19PM +0000, Ondrej Valousek wrote:
>
> >> - AFAIK support for RFC8276 in NFS (only version 4.2) server is since kernel 5.9, right? NFS client supports these as well?
> >> - The patches below implements the feature in both, nfs client AND server, right?
>
> > Client only.
>
> Right, but then it will be only useful if we use non-linux based NFS server right?
>
> I mean simply:
> 1. $ stat /tmp/foo.txt   --> shows birth date
> 2. # exportfs \*/tmp
> 3. # mount 127.0.0.1:/tmp /mnt
> 4. $ stat /mnt/foo.txt   --> no birth date shown

Right.

Fixing that's likely just a few lines of code added to fs/nfsd/nfs4xdr.c:nfsd4_encode_fattr().  Patches welcome.

--b.
Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux