[PATCH 2/7] nfsd: properly xdr-encode deleg stateid returned from open

Benny Halevy
2008-08-12T17:43:53Z

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfsd/nfs4xdr.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index e1a1a5e..cfe9d5c 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2158,7 +2158,9 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_op
break;
case NFS4_OPEN_DELEGATE_READ:
RESERVE_SPACE(20 + sizeof(stateid_t));
- WRITEMEM(&open->op_delegate_stateid, sizeof(stateid_t));
+ WRITE32(open->op_delegate_stateid.si_generation);
+ WRITEMEM(&open->op_delegate_stateid.si_opaque,
+ sizeof(stateid_opaque_t));
WRITE32(open->op_recall);

/*
@@ -2172,7 +2174,9 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_op
break;
case NFS4_OPEN_DELEGATE_WRITE:
RESERVE_SPACE(32 + sizeof(stateid_t));
- WRITEMEM(&open->op_delegate_stateid, sizeof(stateid_t));
+ WRITE32(open->op_delegate_stateid.si_generation);
+ WRITEMEM(&open->op_delegate_stateid.si_opaque,
+ sizeof(stateid_opaque_t));
WRITE32(0);

/*
--
1.5.6.5