Skip to content

Commit

Permalink
nfsd41: error out on repeated RECLAIM_COMPLETE
Browse files Browse the repository at this point in the history
Servers are supposed to return nfserr_complete_already to clients that
attempt to send multiple RECLAIM_COMPLETEs.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Mi Jinlong authored and J. Bruce Fields committed Apr 30, 2011
1 parent 868b89c commit bcecf1c
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,8 @@ nfsd4_sequence(struct svc_rqst *rqstp,
__be32
nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc)
{
int status = 0;

if (rc->rca_one_fs) {
if (!cstate->current_fh.fh_dentry)
return nfserr_nofilehandle;
Expand All @@ -1827,21 +1829,28 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
*/
return nfs_ok;
}

nfs4_lock_state();
if (is_client_expired(cstate->session->se_client)) {
nfs4_unlock_state();
status = nfserr_complete_already;
if (cstate->session->se_client->cl_firststate)
goto out;

status = nfserr_stale_clientid;
if (is_client_expired(cstate->session->se_client))
/*
* The following error isn't really legal.
* But we only get here if the client just explicitly
* destroyed the client. Surely it no longer cares what
* error it gets back on an operation for the dead
* client.
*/
return nfserr_stale_clientid;
}
goto out;

status = nfs_ok;
nfsd4_create_clid_dir(cstate->session->se_client);
out:
nfs4_unlock_state();
return nfs_ok;
return status;
}

__be32
Expand Down

0 comments on commit bcecf1c

Please sign in to comment.