aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-09-22 13:39:16 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-09-27 14:35:11 -0400
commitb134fc4a533300402514154fcb0a661ddf106dd9 (patch)
treea87f84b9bf884d2e14030f791d3f879fea43051f /fs/nfs
parentNFSv4: nfs4_do_handle_exception() handle revoke/expiry of a single stateid (diff)
downloadlinux-dev-b134fc4a533300402514154fcb0a661ddf106dd9.tar.xz
linux-dev-b134fc4a533300402514154fcb0a661ddf106dd9.zip
NFSv4: Don't test open_stateid unless it is set
We need to test the NFS_OPEN_STATE flag for whether or not the open_stateid is valid. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Tested-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 409b9fa2b844..6f0df2c8846c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2587,6 +2587,11 @@ static int nfs41_check_open_stateid(struct nfs4_state *state)
struct rpc_cred *cred = state->owner->so_cred;
int status;
+ if (test_bit(NFS_OPEN_STATE, &state->flags) == 0) {
+ if (test_bit(NFS_DELEGATED_STATE, &state->flags) == 0)
+ return NFS_OK;
+ return -NFS4ERR_BAD_STATEID;
+ }
/* If a state reset has been done, test_stateid is unneeded */
if ((test_bit(NFS_O_RDONLY_STATE, &state->flags) == 0) &&
(test_bit(NFS_O_WRONLY_STATE, &state->flags) == 0) &&