Commit 58cd57bf authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by J. Bruce Fields

nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID

 - don't BUG_ON() when not SP4_NONE
 - calculate recv and send reserve sizes correctly
Signed-off-by: default avatarWeston Andros Adamson <dros@netapp.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent c4720591
...@@ -1524,7 +1524,7 @@ static inline u32 nfsd4_write_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) ...@@ -1524,7 +1524,7 @@ static inline u32 nfsd4_write_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
static inline u32 nfsd4_exchange_id_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op) static inline u32 nfsd4_exchange_id_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{ {
return (op_encode_hdr_size + 2 + 1 + /* eir_clientid, eir_sequenceid */\ return (op_encode_hdr_size + 2 + 1 + /* eir_clientid, eir_sequenceid */\
1 + 1 + 0 + /* eir_flags, spr_how, SP4_NONE (for now) */\ 1 + 1 + 2 + /* eir_flags, spr_how, spo_must_enforce & _allow */\
2 + /*eir_server_owner.so_minor_id */\ 2 + /*eir_server_owner.so_minor_id */\
/* eir_server_owner.so_major_id<> */\ /* eir_server_owner.so_major_id<> */\
XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\
......
...@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
8 /* eir_clientid */ + 8 /* eir_clientid */ +
4 /* eir_sequenceid */ + 4 /* eir_sequenceid */ +
4 /* eir_flags */ + 4 /* eir_flags */ +
4 /* spr_how (SP4_NONE) */ + 4 /* spr_how */ +
8 /* spo_must_enforce, spo_must_allow */ +
8 /* so_minor_id */ + 8 /* so_minor_id */ +
4 /* so_major_id.len */ + 4 /* so_major_id.len */ +
(XDR_QUADLEN(major_id_sz) * 4) + (XDR_QUADLEN(major_id_sz) * 4) +
...@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,
WRITE32(exid->seqid); WRITE32(exid->seqid);
WRITE32(exid->flags); WRITE32(exid->flags);
/* state_protect4_r. Currently only support SP4_NONE */
BUG_ON(exid->spa_how != SP4_NONE);
WRITE32(exid->spa_how); WRITE32(exid->spa_how);
switch (exid->spa_how) { switch (exid->spa_how) {
case SP4_NONE: case SP4_NONE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment