summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-11-11 21:16:27 +0100
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-01-15 16:54:30 +0100
commita3167dacbad3a42dffb78cca8684fafcd94575f9 (patch)
tree50ff28fa03fae6cb8627bb39fef5746603f6deff /fs/nfs/nfs4xdr.c
parentnfs: remove timespec from xdr_encode_nfstime (diff)
downloadlinux-a3167dacbad3a42dffb78cca8684fafcd94575f9.tar.xz
linux-a3167dacbad3a42dffb78cca8684fafcd94575f9.zip
nfs: encode nfsv4 timestamps as 64-bit
On 32-bit architectures, xdr_encode_nfstime4() needlessly truncates timestamps to a 32-bit value in the range between year 1902 and 2038. Change it to use 'struct timespec64' to allow the entire range of values supported by the server. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 728d88b6a698..8de4d250924b 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1061,7 +1061,7 @@ static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *ve
static __be32 *
xdr_encode_nfstime4(__be32 *p, const struct timespec64 *t)
{
- p = xdr_encode_hyper(p, (__s64)t->tv_sec);
+ p = xdr_encode_hyper(p, t->tv_sec);
*p++ = cpu_to_be32(t->tv_nsec);
return p;
}