nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID
Subsystems (2)
PATCH 1/1 nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID
- don't BUG_ON() when not SP4_NONE
- calculate recv and send reserve sizes correctly
--- fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfs4xdr.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
fs/nfsd/nfs4proc.c +1 -1
@@ -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) { 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 */\ /* eir_server_owner.so_major_id<> */\ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\
fs/nfsd/nfs4xdr.c +2 -3
@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,8 /* eir_clientid */ +4 /* eir_sequenceid */ +4 /* eir_flags */ + -4 /* spr_how (SP4_NONE) */ + +4 /* spr_how */ + +8 /* spo_must_enforce, spo_must_allow */ +8 /* so_minor_id */ +4 /* so_major_id.len */ + (XDR_QUADLEN(major_id_sz) * 4) +
@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,WRITE32 (exid->seqid);WRITE32 (exid->flags); -/* state_protect4_r. Currently only support SP4_NONE */ -BUG_ON (exid->spa_how !=SP4_NONE );WRITE32 (exid->spa_how);switch (exid->spa_how) {case SP4_NONE :
Signature · 1 line
1.7.12.4 (Apple Git-37)
Quoted 2 lines · Weston Andros Adamson
- don't
BUG_ON()when notSP4_NONE
- calculate recv and send reserve sizes correctly
Looks good, thanks! (Ouch to that BUG_ON...).
Could I get the client-side code you're using to test this?
It's fine if it's a mess, I just want to be able to run it once and see a mount work.
--b.
Quoted 45 lines
Signed-off-by Weston Andros Adamson <[email protected]>--- fs/nfsd/nfs4proc.c | 2 +- fs/nfsd/nfs4xdr.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)fs/nfsd/nfs4proc.c +1
-1@@ -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) { 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 */\ /* eir_server_owner.so_major_id<> */\ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\fs/nfsd/nfs4xdr.c +2
-3@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,8 /* eir_clientid */ +4 /* eir_sequenceid */ +4 /* eir_flags */ + -4 /* spr_how (SP4_NONE) */ + +4 /* spr_how */ + +8 /* spo_must_enforce, spo_must_allow */ +8 /* so_minor_id */ +4 /* so_major_id.len */ + (XDR_QUADLEN(major_id_sz) * 4) +@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,WRITE32 (exid->seqid);WRITE32 (exid->flags); -/* state_protect4_r. Currently only support SP4_NONE */ -BUG_ON (exid->spa_how !=SP4_NONE );WRITE32 (exid->spa_how);switch (exid->spa_how) {case SP4_NONE :Signature · 1 line
1.7.12.4 (Apple Git-37)
Quoted 11 lines · J. Bruce Fields
Quoted 2 lines · Weston Andros Adamson
- don't
BUG_ON()when notSP4_NONE
- calculate recv and send reserve sizes correctlyLooks good, thanks! (Ouch to that
BUG_ON...).Could I get the client-side code you're using to test this?
It's fine if it's a mess, I just want to be able to run it once and see a mount work.
I just posted a client side patch to the list alongside this patch - it does the basic SP4_MACH_CRED negotiation and nothing else.
I'll be posting more patches implementing specific SP4_MACH_CRED features shortly, but the already posted patch should work for you.
-dros
Quoted 51 lines
--b.
Quoted 45 lines
Signed-off-by Weston Andros Adamson <[email protected]>---
fs/nfsd/nfs4proc.c| 2 +-fs/nfsd/nfs4xdr.c| 5 ++---2 files changed, 3 insertions(+), 4 deletions(-)fs/nfsd/nfs4proc.c +1
-1@@ -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) { 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 */\ /* eir_server_owner.so_major_id<> */\ XDR_QUADLEN(NFS4_OPAQUE_LIMIT) + 1 +\fs/nfsd/nfs4xdr.c +2
-3@@ -3360,7 +3360,8 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,8 /* eir_clientid */ +4 /* eir_sequenceid */ +4 /* eir_flags */ + -4 /* spr_how (SP4_NONE) */ + +4 /* spr_how */ + +8 /* spo_must_enforce, spo_must_allow */ +8 /* so_minor_id */ +4 /* so_major_id.len */ + (XDR_QUADLEN(major_id_sz) * 4) +@@ -3372,8 +3373,6 @@ nfsd4_encode_exchange_id(struct nfsd4_compoundres *resp, __be32 nfserr,WRITE32 (exid->seqid);WRITE32 (exid->flags); -/* state_protect4_r. Currently only support SP4_NONE */ -BUG_ON (exid->spa_how !=SP4_NONE );WRITE32 (exid->spa_how);switch (exid->spa_how) {case SP4_NONE :Signature · 1 line
1.7.12.4 (Apple Git-37)--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 12 lines · Dros
Quoted 8 lines · J. Bruce Fields
Quoted 2 lines · Weston Andros Adamson
- don't
BUG_ON()when notSP4_NONE
- calculate recv and send reserve sizes correctlyLooks good, thanks! (Ouch to that
BUG_ON...).Could I get the client-side code you're using to test this?
Quoted 7 lines
Quoted 3 lines
It's fine if it's a mess, I just want to be able to run it once and see a mount work.
I just posted a client side patch to the list alongside this patch - it does the basic
SP4_MACH_CREDnegotiation and nothing else.I'll be posting more patches implementing specific
SP4_MACH_CREDfeatures shortly, but the already posted patch should work for you.
Oh, I see it. Thanks!
--b.