]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv2: Fix a typo in encode_sattr()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 4 Oct 2019 21:01:54 +0000 (17:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:47:04 +0000 (19:47 +0100)
commit ad97a995d8edff820d4238bd0dfc69f440031ae6 upstream.

Encode the mtime correctly.

Fixes: 95582b0083883 ("vfs: change inode times to use struct timespec64")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs2xdr.c

index 350675e3ed479e11af839fcbbc9b99e1d972b068..040a05f0e61ef0ce98c8b2645e17c402f814a940 100644 (file)
@@ -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);