nfsd: Disable NFSv2 timestamp workaround for NFSv3+
authorAndreas Gruenbacher <andreas.gruenbacher@gmail.com>
Fri, 8 May 2015 22:37:57 +0000 (00:37 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 29 May 2015 15:04:01 +0000 (11:04 -0400)
commitcc265089ce1b176dde963c74b53593446ee7f99a
treefd4e145aa70b1de6cc322e5c8122a8773047f8fa
parent43b0e7ea590b51052384ecedf4ad7c8d7898e8e7
nfsd: Disable NFSv2 timestamp workaround for NFSv3+

NFSv2 can set the atime and/or mtime of a file to specific timestamps but not
to the server's current time.  To implement the equivalent of utimes("file",
NULL), it uses a heuristic.

NFSv3 and later do support setting the atime and/or mtime to the server's
current time directly.  The NFSv2 heuristic is still enabled, and causes
timestamps to be set wrong sometimes.

Fix this by moving the heuristic into the NFSv2 specific code.  We can leave it
out of the create code path: the owner can always set timestamps arbitrarily,
and the workaround would never trigger.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfsproc.c
fs/nfsd/vfs.c