Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104107
b: refs/heads/master
c: f2feb96
h: refs/heads/master
i:
  104105: eef9594
  104103: e855b38
v: v3
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed Jul 2, 2008
1 parent dfc2bd2 commit 775d19c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c375c6f3a809d0d999d6dc933634f0b97ed7ae9
refs/heads/master: f2feb96bc3d18e50cab7de9eab142f99d91aa5f6
17 changes: 14 additions & 3 deletions trunk/fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,11 +1039,21 @@ static nfsd4_dec nfsd4_dec_ops[] = {
[OP_RELEASE_LOCKOWNER] (nfsd4_dec)nfsd4_decode_release_lockowner,
};

struct nfsd4_minorversion_ops {
nfsd4_dec *decoders;
int nops;
};

static struct nfsd4_minorversion_ops nfsd4_minorversion[] = {
[0] { nfsd4_dec_ops, ARRAY_SIZE(nfsd4_dec_ops) },
};

static __be32
nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
{
DECODE_HEAD;
struct nfsd4_op *op;
struct nfsd4_minorversion_ops *ops;
int i;

/*
Expand Down Expand Up @@ -1073,9 +1083,10 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
}
}

if (argp->minorversion != 0)
if (argp->minorversion >= ARRAY_SIZE(nfsd4_minorversion))
argp->opcnt = 0;

ops = &nfsd4_minorversion[argp->minorversion];
for (i = 0; i < argp->opcnt; i++) {
op = &argp->ops[i];
op->replay = NULL;
Expand Down Expand Up @@ -1113,8 +1124,8 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
}
op->opnum = ntohl(*argp->p++);

if (op->opnum >= OP_ACCESS && op->opnum < ARRAY_SIZE(nfsd4_dec_ops))
op->status = nfsd4_dec_ops[op->opnum](argp, &op->u);
if (op->opnum >= OP_ACCESS && op->opnum < ops->nops)
op->status = ops->decoders[op->opnum](argp, &op->u);
else {
op->opnum = OP_ILLEGAL;
op->status = nfserr_op_illegal;
Expand Down

0 comments on commit 775d19c

Please sign in to comment.