NFSv4: Fix problem with OPEN_DOWNGRADE
RFC 3530 states that for OPEN_DOWNGRADE "The share_access and share_deny
bits specified must be exactly equal to the union of the share_access and
share_deny bits specified for some subset of the OPENs in effect for
current openowner on the current file.
Setattr is currently violating the NFSv4 rules for OPEN_DOWNGRADE in that
it may cause a downgrade from OPEN4_SHARE_ACCESS_BOTH to
OPEN4_SHARE_ACCESS_WRITE despite the fact that there exists no open file
with O_WRONLY access mode.
Fix the problem by replacing nfs4_find_state() with a modified version of
nfs_find_open_context().
Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
Showing
- fs/nfs/inode.c 6 additions, 1 deletionfs/nfs/inode.c
- fs/nfs/nfs4_fs.h 0 additions, 1 deletionfs/nfs/nfs4_fs.h
- fs/nfs/nfs4proc.c 10 additions, 13 deletionsfs/nfs/nfs4proc.c
- fs/nfs/nfs4state.c 0 additions, 33 deletionsfs/nfs/nfs4state.c
- fs/nfs/read.c 2 additions, 2 deletionsfs/nfs/read.c
- fs/nfs/write.c 1 addition, 1 deletionfs/nfs/write.c
- include/linux/nfs_fs.h 1 addition, 1 deletioninclude/linux/nfs_fs.h
Loading
Please register or sign in to comment