Commit 7e0f7cf5 authored by J. Bruce Fields's avatar J. Bruce Fields

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: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 203a8c8e
...@@ -2418,10 +2418,9 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, ...@@ -2418,10 +2418,9 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
status = nfserr_stale_stateid; status = nfserr_stale_stateid;
if (STALE_STATEID(stateid)) if (STALE_STATEID(stateid))
goto out; goto out;
status = nfs_ok; status = nfserr_bad_stateid;
if (!is_delegation_stateid(stateid)) if (!is_delegation_stateid(stateid))
goto out; goto out;
status = nfserr_bad_stateid;
dp = find_delegation_stateid(inode, stateid); dp = find_delegation_stateid(inode, stateid);
if (!dp) if (!dp)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment