]> 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)
commit9cdce12156202f3b5d4c42b0b2998bb3e9619505
tree231e1b89853c6428f45cf5d04ab68e8e628dd863
parent0c45c359776a1bfa9852d18a28974a4960151ad3
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