nfsd4: fail when delegreturn gets a non-delegation stateid
authorJ. Bruce Fields <bfields@citi.umich.edu>
Sat, 21 Feb 2009 21:32:28 +0000 (13:32 -0800)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 18 Mar 2009 21:38:37 +0000 (17:38 -0400)
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>
fs/nfsd/nfs4state.c

index 3570a0d1133f5fe18d509c45bb39d98c110af32c..6ae28e606afc9e82c61589cb9e10dab5b17ac344 100644 (file)
@@ -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;