nfsd: encode stat->mtime for getattr instead of inode->i_mtime
authorAmir Goldstein <amir73il@gmail.com>
Wed, 3 Jan 2018 15:14:34 +0000 (17:14 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 8 Feb 2018 18:40:16 +0000 (13:40 -0500)
commit76c479480b9afff4c585a17e19a1efe3457a2d9b
tree231e1b89853c6428f45cf5d04ab68e8e628dd863
parent0078117c6d9160031b866cfa1853514d4f6865d2
nfsd: encode stat->mtime for getattr instead of inode->i_mtime

The values of stat->mtime and inode->i_mtime may differ for overlayfs
and stat->mtime is the correct value to use when encoding getattr.
This is also consistent with the fact that other attr times are also
encoded from stat values.

Both callers of lease_get_mtime() already have the value of stat->mtime,
so the only needed change is that lease_get_mtime() will not overwrite
this value with inode->i_mtime in case the inode does not have an
exclusive lease.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/locks.c
fs/nfsd/nfsxdr.c