[pnfs] [PATCH 1/2] Update server exchange id to draft 13 linux-pnfs-2.6-latest

andros at umich.edu andros at umich.edu
Thu Sep 13 14:54:28 EDT 2007


From: Andy Adamson <andros at umich.edu>

For now, the server will only support SP4_NONE.
Decode state_protect4_r into dummy variables.
Encode SP4_NONE state_protect4_r.
Correct the nfsd4_encode_exchange_id large RESERVE_SPACE.

Signed off by: Andy Adamson<andros at umich.edu>
---
 fs/nfsd/nfs4xdr.c    |   42 ++++++++++++++++++++++++++++++++++++++++++
 include/linux/nfs4.h |    7 +++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 971f1c2..6807ad8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -954,6 +954,45 @@ nfsd4_decode_exchange_id(struct nfsd4_compoundargs *argp, struct nfsd4_exchange_
         READ_BUF(4);
         READ32(clid->flags);
 
+	/* Ignore state_protect4_a */
+	READ_BUF(4);
+	READ32(dummy);
+	switch(dummy) {
+		case SP4_NONE:
+			break;
+		case SP4_MACH_CRED:
+			READ_BUF(8);
+			READ32(dummy);
+			READ32(dummy);
+			break;
+		case SP4_SSV:
+			/* ssp_ops */
+			READ_BUF(8);
+			READ32(dummy);
+			READ32(dummy);
+
+			/* ssp_hash_algs<> */
+			READ_BUF(4);
+			READ32(dummy);
+			READ_BUF(dummy);
+			p += XDR_QUADLEN(dummy);
+
+			/* ssp_encr_algs<> */
+			READ_BUF(4);
+			READ32(dummy);
+			READ_BUF(dummy);
+			p += XDR_QUADLEN(dummy);
+
+			/* ssp_window and ssp_num_gss_handles */
+			READ_BUF(8);
+			READ32(dummy);
+			READ32(dummy);
+
+			break;
+		default:
+			goto xdr_error;
+	}
+
         /* Ignore Implementation ID */
         READ_BUF(4);    /* nfs_impl_id4 array length */
         READ32(dummy);
@@ -3034,6 +3073,9 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, int nfserr, struct nfsd
 		WRITE32(exid->seqid);
 		WRITE32(exid->flags);
 
+		/* state_protect4_r */
+		WRITE32(SP4_NONE);
+
 		/* The server_owner struct */
 		WRITE64(minor_id);      /* Minor id */
 		/* major id */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 36bfd37..ca8eb46 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -525,6 +525,13 @@ enum filelayout_hint_care4 {
 #define SESSION4_BACK_CHAN 	 0x002
 #define SESSION4_RDMA		 0x004
 
+enum state_protect_how4 {
+	SP4_NONE	= 0,
+	SP4_MACH_CRED	= 1,
+	SP4_SSV		= 2
+};
+
+
 #endif
 #endif
 
-- 
1.5.0.2



More information about the pNFS mailing list