summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-02-21 13:32:28 -0800
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-03-18 17:38:37 -0400
commit7e0f7cf582abd6c85232331dfe726a4e4b0fd98e (patch)
treea6a8aa7d51538377df5e2ce076c347ccd63b6b5b
parent203a8c8e66278a5936a230edaac29017e50c88fb (diff)
nfsd4: fail when delegreturn gets a non-delegation stateid
Previous cleanup reveals an obvious (though harmless) bug: when delegreturn gets a stateid that isn't for a delegation, it should return an error rather than doing nothing. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfs4state.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3570a0d1133..6ae28e606af 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2418,10 +2418,9 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfserr_stale_stateid;
if (STALE_STATEID(stateid))
goto out;
- status = nfs_ok;
+ status = nfserr_bad_stateid;
if (!is_delegation_stateid(stateid))
goto out;
- status = nfserr_bad_stateid;
dp = find_delegation_stateid(inode, stateid);
if (!dp)
goto out;