]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Default change_attr_type to NFS4_CHANGE_TYPE_IS_UNDEFINED
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sun, 26 Sep 2021 18:05:04 +0000 (14:05 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 00:49:06 +0000 (20:49 -0400)
commit81a2320efd0588c47de64cd69ff12689f061b93f
tree78c285736096636c1be78e6e709ef4c3b14713d9
parent5959e8c98e84cf75a0ed4668ea6edc397f40aa38
NFS: Default change_attr_type to NFS4_CHANGE_TYPE_IS_UNDEFINED

Both NFSv3 and NFSv2 generate their change attribute from the ctime
value that was supplied by the server. However the problem is that there
are plenty of servers out there with ctime resolutions of 1ms or worse.
In a modern performance system, this is insufficient when trying to
decide which is the most recent set of attributes when, for instance, a
READ or GETATTR call races with a WRITE or SETATTR.

For this reason, let's revert to labelling the NFSv2/v3 change
attributes as NFS4_CHANGE_TYPE_IS_UNDEFINED. This will ensure we protect
against such races.

Fixes: b0303ec0f7cc ("NFS: Another inode revalidation improvement")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfs/inode.c
fs/nfs/nfs3xdr.c
fs/nfs/proc.c