All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client
@ 2009-12-12  3:10 Ricardo Labiaga
  2009-12-12  3:10 ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops Ricardo Labiaga
  2010-01-14 17:26 ` [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client J. Bruce Fields
  0 siblings, 2 replies; 5+ messages in thread
From: Ricardo Labiaga @ 2009-12-12  3:10 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Ricardo Labiaga

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
---
 fs/nfsd/nfs4state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 2153f9b..32aa837 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2487,8 +2487,10 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
 	}
 	memcpy(&open->op_stateid, &stp->st_stateid, sizeof(stateid_t));
 
-	if (nfsd4_has_session(&resp->cstate))
+	if (nfsd4_has_session(&resp->cstate)) {
 		open->op_stateowner->so_confirmed = 1;
+		nfsd4_create_clid_dir(open->op_stateowner->so_client);
+	}
 
 	/*
 	* Attempt to hand out a delegation. No error return, because the
-- 
1.5.4.3


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

* [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops
  2009-12-12  3:10 [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client Ricardo Labiaga
@ 2009-12-12  3:10 ` Ricardo Labiaga
  2009-12-17 15:54   ` J. Bruce Fields
  2010-01-14 17:26 ` [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client J. Bruce Fields
  1 sibling, 1 reply; 5+ messages in thread
From: Ricardo Labiaga @ 2009-12-12  3:10 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Ricardo Labiaga

The server incorrectly assumes that the operations in the
array start with value 0.  The first operation (OP_ACCESS)
has a value of 3, causing the check in nfsd4_decode_compound
to be off.

Instead of comparing that the operation number is less than
the number of elements in the array, the server should verify
that it is less than the maximum valid operation number
defined by LAST_NFS4_OP.

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
---
 fs/nfsd/nfs4xdr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 0fbd50c..b83a24c 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1442,7 +1442,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
 		}
 		op->opnum = ntohl(*argp->p++);
 
-		if (op->opnum >= OP_ACCESS && op->opnum < ops->nops)
+		if (op->opnum >= OP_ACCESS && op->opnum <= LAST_NFS4_OP)
 			op->status = ops->decoders[op->opnum](argp, &op->u);
 		else {
 			op->opnum = OP_ILLEGAL;
-- 
1.5.4.3


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

* Re: [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops
  2009-12-12  3:10 ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops Ricardo Labiaga
@ 2009-12-17 15:54   ` J. Bruce Fields
  2009-12-17 16:39     ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize allops Labiaga, Ricardo
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2009-12-17 15:54 UTC (permalink / raw)
  To: Ricardo Labiaga; +Cc: linux-nfs

On Fri, Dec 11, 2009 at 07:10:49PM -0800, Ricardo Labiaga wrote:
> The server incorrectly assumes that the operations in the
> array start with value 0.  The first operation (OP_ACCESS)
> has a value of 3, causing the check in nfsd4_decode_compound
> to be off.
> 
> Instead of comparing that the operation number is less than
> the number of elements in the array, the server should verify
> that it is less than the maximum valid operation number
> defined by LAST_NFS4_OP.

Thanks.  So the effect of this was to return an OP_ILLEGAL in some cases
where we should have been returning a NOTSUPP error?

--b.

> 
> Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
> ---
>  fs/nfsd/nfs4xdr.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 0fbd50c..b83a24c 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -1442,7 +1442,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
>  		}
>  		op->opnum = ntohl(*argp->p++);
>  
> -		if (op->opnum >= OP_ACCESS && op->opnum < ops->nops)
> +		if (op->opnum >= OP_ACCESS && op->opnum <= LAST_NFS4_OP)
>  			op->status = ops->decoders[op->opnum](argp, &op->u);
>  		else {
>  			op->opnum = OP_ILLEGAL;
> -- 
> 1.5.4.3
> 

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

* Re: [PATCH] nfsd41: nfsd4_decode_compound() does not recognize allops
  2009-12-17 15:54   ` J. Bruce Fields
@ 2009-12-17 16:39     ` Labiaga, Ricardo
  0 siblings, 0 replies; 5+ messages in thread
From: Labiaga, Ricardo @ 2009-12-17 16:39 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs

That's right.

- ricardo

On Dec 17, 2009, at 7:53 AM, "J. Bruce Fields" <bfields@fieldses.org>  
wrote:

> On Fri, Dec 11, 2009 at 07:10:49PM -0800, Ricardo Labiaga wrote:
>> The server incorrectly assumes that the operations in the
>> array start with value 0.  The first operation (OP_ACCESS)
>> has a value of 3, causing the check in nfsd4_decode_compound
>> to be off.
>>
>> Instead of comparing that the operation number is less than
>> the number of elements in the array, the server should verify
>> that it is less than the maximum valid operation number
>> defined by LAST_NFS4_OP.
>
> Thanks.  So the effect of this was to return an OP_ILLEGAL in some  
> cases
> where we should have been returning a NOTSUPP error?
>
> --b.
>
>>
>> Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
>> ---
>> fs/nfsd/nfs4xdr.c |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
>> index 0fbd50c..b83a24c 100644
>> --- a/fs/nfsd/nfs4xdr.c
>> +++ b/fs/nfsd/nfs4xdr.c
>> @@ -1442,7 +1442,7 @@ nfsd4_decode_compound(struct  
>> nfsd4_compoundargs *argp)
>>        }
>>        op->opnum = ntohl(*argp->p++);
>>
>> -        if (op->opnum >= OP_ACCESS && op->opnum < ops->nops)
>> +        if (op->opnum >= OP_ACCESS && op->opnum <= LAST_NFS4_OP)
>>            op->status = ops->decoders[op->opnum](argp, &op->u);
>>        else {
>>            op->opnum = OP_ILLEGAL;
>> -- 
>> 1.5.4.3
>>

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

* Re: [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client
  2009-12-12  3:10 [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client Ricardo Labiaga
  2009-12-12  3:10 ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops Ricardo Labiaga
@ 2010-01-14 17:26 ` J. Bruce Fields
  1 sibling, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2010-01-14 17:26 UTC (permalink / raw)
  To: Ricardo Labiaga; +Cc: linux-nfs

On Fri, Dec 11, 2009 at 07:10:48PM -0800, Ricardo Labiaga wrote:
> Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>

Thanks, looks right--applied.

--b.

> ---
>  fs/nfsd/nfs4state.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 2153f9b..32aa837 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2487,8 +2487,10 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
>  	}
>  	memcpy(&open->op_stateid, &stp->st_stateid, sizeof(stateid_t));
>  
> -	if (nfsd4_has_session(&resp->cstate))
> +	if (nfsd4_has_session(&resp->cstate)) {
>  		open->op_stateowner->so_confirmed = 1;
> +		nfsd4_create_clid_dir(open->op_stateowner->so_client);
> +	}
>  
>  	/*
>  	* Attempt to hand out a delegation. No error return, because the
> -- 
> 1.5.4.3
> 

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

end of thread, other threads:[~2010-01-14 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-12  3:10 [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client Ricardo Labiaga
2009-12-12  3:10 ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops Ricardo Labiaga
2009-12-17 15:54   ` J. Bruce Fields
2009-12-17 16:39     ` [PATCH] nfsd41: nfsd4_decode_compound() does not recognize allops Labiaga, Ricardo
2010-01-14 17:26 ` [PATCH] nfsd41: Create the recovery entry for the NFSv4.1 client J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.