linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd41: donot check reclaim for open with filehandle
@ 2011-11-17  2:25 Mi Jinlong
  2011-11-22 22:08 ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Mi Jinlong @ 2011-11-17  2:25 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: NFS

Opening file with filehandle, check reclaim is not needed.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 fs/nfsd/nfs4proc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index fa38336..681dff3 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -266,8 +266,9 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
 {
 	__be32 status;
 
-	/* Only reclaims from previously confirmed clients are valid */
-	if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
+	if (open->op_claim_type != NFS4_OPEN_CLAIM_FH
+	    && open->op_claim_type != NFS4_OPEN_CLAIM_DELEG_CUR_FH
+	    && (status = nfs4_check_open_reclaim(&open->op_clientid)))
 		return status;
 
 	/* We don't know the target directory, and therefore can not
-- 
1.7.7



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nfsd41: donot check reclaim for open with filehandle
  2011-11-17  2:25 [PATCH] nfsd41: donot check reclaim for open with filehandle Mi Jinlong
@ 2011-11-22 22:08 ` J. Bruce Fields
  2011-11-23  2:48   ` [PATCH v2] nfsd41: check reclaim for open claim previous at nfsd4_open Mi Jinlong
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bruce Fields @ 2011-11-22 22:08 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Thu, Nov 17, 2011 at 10:25:53AM +0800, Mi Jinlong wrote:
> Opening file with filehandle, check reclaim is not needed.
> 
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
>  fs/nfsd/nfs4proc.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index fa38336..681dff3 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -266,8 +266,9 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
>  {
>  	__be32 status;
>  
> -	/* Only reclaims from previously confirmed clients are valid */
> -	if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
> +	if (open->op_claim_type != NFS4_OPEN_CLAIM_FH
> +	    && open->op_claim_type != NFS4_OPEN_CLAIM_DELEG_CUR_FH

Thanks for catching that.

I think it would be simpler to pull this check out into nfsd4_open(),
something like:

	case NFS4_OPEN_CLAIM_PREVIOUS:
		open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
		status = nfs4_check_open_reclaim(&open->op_clientid);
		if (status)
			goto out;
	case NFS4_OPEN_CLAIM_FH:
	...

--b.

> +	    && (status = nfs4_check_open_reclaim(&open->op_clientid)))
>  		return status;
>  
>  	/* We don't know the target directory, and therefore can not
> -- 
> 1.7.7
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] nfsd41: check reclaim for open claim previous at nfsd4_open
  2011-11-22 22:08 ` J. Bruce Fields
@ 2011-11-23  2:48   ` Mi Jinlong
  2011-11-30 23:55     ` J. Bruce Fields
  0 siblings, 1 reply; 4+ messages in thread
From: Mi Jinlong @ 2011-11-23  2:48 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: NFS

Opening file with filehandle, check reclaim is not needed.
So, let open reclaim check at nfsd4_open.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 fs/nfsd/nfs4proc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index fa38336..9415bc4 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -266,10 +266,6 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
 {
 	__be32 status;
 
-	/* Only reclaims from previously confirmed clients are valid */
-	if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
-		return status;
-
 	/* We don't know the target directory, and therefore can not
 	* set the change info
 	*/
@@ -373,6 +369,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 			break;
 		case NFS4_OPEN_CLAIM_PREVIOUS:
 			open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
+			status = nfs4_check_open_reclaim(&open->op_clientid);
+			if (status)
+				goto out;
 		case NFS4_OPEN_CLAIM_FH:
 		case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
 			status = do_open_fhandle(rqstp, &cstate->current_fh,
-- 
1.7.7



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] nfsd41: check reclaim for open claim previous at nfsd4_open
  2011-11-23  2:48   ` [PATCH v2] nfsd41: check reclaim for open claim previous at nfsd4_open Mi Jinlong
@ 2011-11-30 23:55     ` J. Bruce Fields
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bruce Fields @ 2011-11-30 23:55 UTC (permalink / raw)
  To: Mi Jinlong; +Cc: NFS

On Wed, Nov 23, 2011 at 10:48:40AM +0800, Mi Jinlong wrote:
> Opening file with filehandle, check reclaim is not needed.
> So, let open reclaim check at nfsd4_open.

Thanks!  Applying for 3.3.--b.

> 
> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
> ---
>  fs/nfsd/nfs4proc.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index fa38336..9415bc4 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -266,10 +266,6 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
>  {
>  	__be32 status;
>  
> -	/* Only reclaims from previously confirmed clients are valid */
> -	if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
> -		return status;
> -
>  	/* We don't know the target directory, and therefore can not
>  	* set the change info
>  	*/
> @@ -373,6 +369,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  			break;
>  		case NFS4_OPEN_CLAIM_PREVIOUS:
>  			open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
> +			status = nfs4_check_open_reclaim(&open->op_clientid);
> +			if (status)
> +				goto out;
>  		case NFS4_OPEN_CLAIM_FH:
>  		case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
>  			status = do_open_fhandle(rqstp, &cstate->current_fh,
> -- 
> 1.7.7
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-30 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  2:25 [PATCH] nfsd41: donot check reclaim for open with filehandle Mi Jinlong
2011-11-22 22:08 ` J. Bruce Fields
2011-11-23  2:48   ` [PATCH v2] nfsd41: check reclaim for open claim previous at nfsd4_open Mi Jinlong
2011-11-30 23:55     ` 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).