Skip to content

Commit 9f76628

Browse files
committed
Merge branch 'for-3.18' of git://linux-nfs.org/~bfields/linux
Pull two nfsd fixes from Bruce Fields: "One regression from the 3.16 xdr rewrite, one an older bug exposed by a separate bug in the client's new SEEK code" * 'for-3.18' of git://linux-nfs.org/~bfields/linux: nfsd4: fix crash on unknown operation number nfsd4: fix response size estimation for OP_SEQUENCE
2 parents 6234056 + 51904b0 commit 9f76628

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,8 @@ static bool need_wrongsec_check(struct svc_rqst *rqstp)
12721272
*/
12731273
if (argp->opcnt == resp->opcnt)
12741274
return false;
1275-
1275+
if (next->opnum == OP_ILLEGAL)
1276+
return false;
12761277
nextd = OPDESC(next);
12771278
/*
12781279
* Rest of 2.6.3.1.1: certain operations will return WRONGSEC
@@ -1589,7 +1590,8 @@ static inline u32 nfsd4_rename_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op
15891590
static inline u32 nfsd4_sequence_rsize(struct svc_rqst *rqstp,
15901591
struct nfsd4_op *op)
15911592
{
1592-
return NFS4_MAX_SESSIONID_LEN + 20;
1593+
return (op_encode_hdr_size
1594+
+ XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) * sizeof(__be32);
15931595
}
15941596

15951597
static inline u32 nfsd4_setattr_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
@@ -1893,6 +1895,7 @@ static struct nfsd4_operation nfsd4_ops[] = {
18931895
.op_func = (nfsd4op_func)nfsd4_sequence,
18941896
.op_flags = ALLOWED_WITHOUT_FH | ALLOWED_AS_FIRST_OP,
18951897
.op_name = "OP_SEQUENCE",
1898+
.op_rsize_bop = (nfsd4op_rsize)nfsd4_sequence_rsize,
18961899
},
18971900
[OP_DESTROY_CLIENTID] = {
18981901
.op_func = (nfsd4op_func)nfsd4_destroy_clientid,

0 commit comments

Comments
 (0)