Message ID | 4E447EEB.501@panasas.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
With this patch I'm back to the previous behavior. That is wait your grace period then continue. --- NFSD: Remove a wrong check in nfs4_open We are already doing the proper grace period checking farther down in nfs4_open. This check was just checking nothing and was totally unrelated to the comment about "RECLAIM_COMPLETE". It was a bug because if an open was coming before the grace period end, it would then never pass the condition of not being cl_firststate. Boaz --- @@ -295,15 +295,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) return nfserr_inval; - /* - * RFC5661 18.51.3 - * Before RECLAIM_COMPLETE done, server should deny new lock - */ - if (nfsd4_has_session(cstate) && - !cstate->session->se_client->cl_firststate && - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) - return nfserr_grace; - if (nfsd4_has_session(cstate)) copy_clientid(&open->op_clientid, cstate->session); -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Aug 11, 2011 at 06:29:20PM -0700, Boaz Harrosh wrote: > With this patch I'm back to the previous behavior. That is > wait your grace period then continue. Is it true for some reason that the client never sends RECLAIM_COMPLETE? --b. > > --- > NFSD: Remove a wrong check in nfs4_open > > We are already doing the proper grace period checking > farther down in nfs4_open. This check was just checking > nothing and was totally unrelated to the comment about > "RECLAIM_COMPLETE". It was a bug because if an open was > coming before the grace period end, it would then never > pass the condition of not being cl_firststate. > > Boaz > > --- > @@ -295,15 +295,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, > if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) > return nfserr_inval; > > - /* > - * RFC5661 18.51.3 > - * Before RECLAIM_COMPLETE done, server should deny new lock > - */ > - if (nfsd4_has_session(cstate) && > - !cstate->session->se_client->cl_firststate && > - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) > - return nfserr_grace; > - > if (nfsd4_has_session(cstate)) > copy_clientid(&open->op_clientid, cstate->session); > > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Aug 11, 2011 at 10:15 PM, J. Bruce Fields <bfields@redhat.com> wrote: > On Thu, Aug 11, 2011 at 06:29:20PM -0700, Boaz Harrosh wrote: >> With this patch I'm back to the previous behavior. That is >> wait your grace period then continue. > > Is it true for some reason that the client never sends RECLAIM_COMPLETE? I tested this yesterday with the windows client and saw the same never-ending grace period on OPEN. We do send RECLAIM_COMPLETE, and it completes successfully. Other operations like CREATE and REMOVE succeed as well. > > --b. > >> >> --- >> NFSD: Remove a wrong check in nfs4_open >> >> We are already doing the proper grace period checking >> farther down in nfs4_open. This check was just checking >> nothing and was totally unrelated to the comment about >> "RECLAIM_COMPLETE". It was a bug because if an open was >> coming before the grace period end, it would then never >> pass the condition of not being cl_firststate. >> >> Boaz >> >> --- >> @@ -295,15 +295,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, >> if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) >> return nfserr_inval; >> >> - /* >> - * RFC5661 18.51.3 >> - * Before RECLAIM_COMPLETE done, server should deny new lock >> - */ >> - if (nfsd4_has_session(cstate) && >> - !cstate->session->se_client->cl_firststate && >> - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) >> - return nfserr_grace; >> - >> if (nfsd4_has_session(cstate)) >> copy_clientid(&open->op_clientid, cstate->session); >> >> > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, 2011-08-11 at 18:29 -0700, Boaz Harrosh wrote: > With this patch I'm back to the previous behavior. That is > wait your grace period then continue. > > --- > NFSD: Remove a wrong check in nfs4_open > > We are already doing the proper grace period checking > farther down in nfs4_open. This check was just checking > nothing and was totally unrelated to the comment about > "RECLAIM_COMPLETE". It was a bug because if an open was > coming before the grace period end, it would then never > pass the condition of not being cl_firststate. > > Boaz > > --- > @@ -295,15 +295,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, > if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) > return nfserr_inval; > > - /* > - * RFC5661 18.51.3 > - * Before RECLAIM_COMPLETE done, server should deny new lock > - */ > - if (nfsd4_has_session(cstate) && > - !cstate->session->se_client->cl_firststate && > - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) > - return nfserr_grace; > - BTW: restricting opens to CLAIM_PREVIOUS only during the grace period seems wrong. If I have already reclaimed my delegation, then why shouldn't I be able to do a CLAIM_DELEGATE_CUR and/or CLAIM_DELEG_CUR_FH open? It is not as if those can ever cause a lock that will conflict with some other client's lock reclaims. Trond
On Fri, Aug 12, 2011 at 11:52:05AM -0400, Trond Myklebust wrote: > On Thu, 2011-08-11 at 18:29 -0700, Boaz Harrosh wrote: > > With this patch I'm back to the previous behavior. That is > > wait your grace period then continue. > > > > --- > > NFSD: Remove a wrong check in nfs4_open > > > > We are already doing the proper grace period checking > > farther down in nfs4_open. This check was just checking > > nothing and was totally unrelated to the comment about > > "RECLAIM_COMPLETE". It was a bug because if an open was > > coming before the grace period end, it would then never > > pass the condition of not being cl_firststate. > > > > Boaz > > > > --- > > @@ -295,15 +295,6 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, > > if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) > > return nfserr_inval; > > > > - /* > > - * RFC5661 18.51.3 > > - * Before RECLAIM_COMPLETE done, server should deny new lock > > - */ > > - if (nfsd4_has_session(cstate) && > > - !cstate->session->se_client->cl_firststate && > > - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) > > - return nfserr_grace; > > - > > BTW: restricting opens to CLAIM_PREVIOUS only during the grace period > seems wrong. > > If I have already reclaimed my delegation, then why shouldn't I be able > to do a CLAIM_DELEGATE_CUR and/or CLAIM_DELEG_CUR_FH open? It is not as > if those can ever cause a lock that will conflict with some other > client's lock reclaims. I was assuming the client had to send a reclaim_complete before it could do that, but... I think you're right, those must fall under the "reclaim operations" that a client is allowed to do before the reclaim_complete. I need to look at rfc 5661 10.2.1--I don't think we have that stuff right at all. Argh. --b. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a68384f..8eae742 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -301,8 +301,10 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, */ if (nfsd4_has_session(cstate) && !cstate->session->se_client->cl_firststate && - open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) + open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) { + printk(KERN_ERR "!!! Before RECLAIM_COMPLETE done\n"); return nfserr_grace; + } if (nfsd4_has_session(cstate)) copy_clientid(&open->op_clientid, cstate->session); Is that new code? and this print below is never shown: diff --git a/fs/lockd/grace.c b/fs/lockd/grace.c index 183cc1f..202c3e7 100644 --- a/fs/lockd/grace.c +++ b/fs/lockd/grace.c @@ -54,6 +54,10 @@ EXPORT_SYMBOL_GPL(locks_end_grace); */ int locks_in_grace(void) { - return !list_empty(&grace_list); + int ret = !list_empty(&grace_list); + + if (ret) + printk(KERN_ERR "locks_in_grace => true\n"); + return ret; } EXPORT_SYMBOL_GPL(locks_in_grace);