From: Trond Myklebust Date: Fri, 4 Oct 2019 21:01:54 +0000 (-0400) Subject: NFSv2: Fix a typo in encode_sattr() X-Git-Tag: v4.19.97~42 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04b173066116b523c8bc5957e4e105865b3f7a33;p=thirdparty%2Fkernel%2Fstable.git NFSv2: Fix a typo in encode_sattr() commit ad97a995d8edff820d4238bd0dfc69f440031ae6 upstream. Encode the mtime correctly. Fixes: 95582b0083883 ("vfs: change inode times to use struct timespec64") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 350675e3ed479..040a05f0e61ef 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c @@ -385,7 +385,7 @@ static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) } else p = xdr_time_not_set(p); if (attr->ia_valid & ATTR_MTIME_SET) { - ts = timespec64_to_timespec(attr->ia_atime); + ts = timespec64_to_timespec(attr->ia_mtime); xdr_encode_time(p, &ts); } else if (attr->ia_valid & ATTR_MTIME) { ts = timespec64_to_timespec(attr->ia_mtime);