* [PATCH] nfsd41: Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE.
@ 2011-04-27 1:14 Mi Jinlong
2011-05-03 2:46 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Mi Jinlong @ 2011-04-27 1:14 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: NFS
Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE.
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
fs/nfsd/nfs4state.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 43cda94..8d521d8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1804,6 +1804,8 @@ out:
__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;
@@ -1813,9 +1815,14 @@ 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
@@ -1823,11 +1830,13 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
* 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
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nfsd41: Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE.
2011-04-27 1:14 [PATCH] nfsd41: Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE Mi Jinlong
@ 2011-05-03 2:46 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2011-05-03 2:46 UTC (permalink / raw)
To: Mi Jinlong; +Cc: NFS
On Wed, Apr 27, 2011 at 09:14:30AM +0800, Mi Jinlong wrote:
> Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE.
Applying for 2.6.40, thanks.--b.
>
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
> fs/nfsd/nfs4state.c | 19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 43cda94..8d521d8 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1804,6 +1804,8 @@ out:
> __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;
> @@ -1813,9 +1815,14 @@ 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
> @@ -1823,11 +1830,13 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
> * 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
> --
> 1.7.4.1
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-03 2:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 1:14 [PATCH] nfsd41: Make sure nfs server can distinguish client's retry RECLAIM_COMPLETE Mi Jinlong
2011-05-03 2:46 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).