Skip to content

Commit

Permalink
nfsd: return nfserr_minor_vers_mismatch when compound minorversion != 0
Browse files Browse the repository at this point in the history
Check minorversion once before decoding any operation and reject with
nfserr_minor_vers_mismatch if != 0 (this still happens in nfsd4_proc_compound).
In this case return a zero length resultdata array as required by RFC3530.

minorversion 1 processing will have its own vector of decoders.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
Benny Halevy authored and J. Bruce Fields committed Jul 2, 2008
1 parent 07cad1d commit 30cff1f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,9 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
}
}

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

for (i = 0; i < argp->opcnt; i++) {
op = &argp->ops[i];
op->replay = NULL;
Expand Down Expand Up @@ -1057,13 +1060,6 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
op->opnum = ntohl(*argp->p++);

switch (op->opnum) {
case 2: /* Reserved operation */
op->opnum = OP_ILLEGAL;
if (argp->minorversion == 0)
op->status = nfserr_op_illegal;
else
op->status = nfserr_minor_vers_mismatch;
break;
case OP_ACCESS:
op->status = nfsd4_decode_access(argp, &op->u.access);
break;
Expand Down

0 comments on commit 30cff1f

Please sign in to comment.