Skip to contentSkip to conversation

nfsd41: Create the recovery entry for the NFSv4.1 client

PATCH In review Ricardo Labiaga 2 participants 5 messages Dec 12, 2009 – Jan 14, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd41: Create the recovery entry for the NFSv4.1 client

---
 fs/nfsd/nfs4state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +3 -1
index 2153f9b..32aa837 100644
@@ -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
Signature · 1 line
1.5.4.3
#1 lore raw

PATCH 1/1 nfsd41: nfsd4_decode_compound() does not recognize all ops

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.

---
 fs/nfsd/nfs4xdr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4xdr.c +1 -1
index 0fbd50c..b83a24c 100644
@@ -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;
Signature · 1 line
1.5.4.3
#2 lore raw

Re: [PATCH] nfsd41: nfsd4_decode_compound() does not recognize all ops

Quoted 9 lines · 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.

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.

Quoted 22 lines
---
 fs/nfsd/nfs4xdr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4xdr.c +1 -1
index 0fbd50c..b83a24c 100644
@@ -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;
Signature · 1 line
1.5.4.3
#3 lore raw

Re: [PATCH] nfsd41: nfsd4_decode_compound() does not recognize allops

That's right.

- ricardo

Quoted 39 lines · J. Bruce Fields
Quoted 9 lines · 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.

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.

Quoted 23 lines

---
fs/nfsd/nfs4xdr.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4xdr.c +1 -1
index 0fbd50c..b83a24c 100644
@@ -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;
Signature · 1 line
1.5.4.3
#4 lore raw
In reply to Ricardo Labiaga
Quoted 1 line · Ricardo Labiaga

Thanks, looks right--applied.

--b.

Quoted 23 lines
---
 fs/nfsd/nfs4state.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfsd/nfs4state.c +3 -1
index 2153f9b..32aa837 100644
@@ -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
Signature · 1 line
1.5.4.3