diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2024-02-16 02:24:51 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-03-01 15:12:33 +0100 |
commit | 24d92de9186ebc340687caf7356e1070773e67bc (patch) | |
tree | 5ce32cf2925b847c755d5f3b4a9daf91390264e0 /fs/nfsd/xdr3.h | |
parent | nfsd: Fix a regression in nfsd_setattr() (diff) | |
download | linux-24d92de9186ebc340687caf7356e1070773e67bc.tar.xz linux-24d92de9186ebc340687caf7356e1070773e67bc.zip |
nfsd: Fix NFSv3 atomicity bugs in nfsd_setattr()
The main point of the guarded SETATTR is to prevent races with other
WRITE and SETATTR calls. That requires that the check of the guard time
against the inode ctime be done after taking the inode lock.
Furthermore, we need to take into account the 32-bit nature of
timestamps in NFSv3, and the possibility that files may change at a
faster rate than once a second.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/xdr3.h')
-rw-r--r-- | fs/nfsd/xdr3.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/xdr3.h b/fs/nfsd/xdr3.h index 03fe4e21306c..522067b7fd75 100644 --- a/fs/nfsd/xdr3.h +++ b/fs/nfsd/xdr3.h @@ -14,7 +14,7 @@ struct nfsd3_sattrargs { struct svc_fh fh; struct iattr attrs; int check_guard; - time64_t guardtime; + struct timespec64 guardtime; }; struct nfsd3_diropargs { |