]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitfe0fafbddc83ae5711e8caadaaa97c994278bc48
tree231e1b89853c6428f45cf5d04ab68e8e628dd863
parentdebb2bb008f42e4c5cce86f8f5eff17f9f55c5e0
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