Przeglądaj źródła

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>
J. Bruce Fields 16 lat temu
rodzic
commit
7e0f7cf582
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      fs/nfsd/nfs4state.c

+ 1 - 2
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;