aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnna Schumaker <bjschuma@netapp.com>2013-10-30 13:38:13 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-10-30 18:25:04 -0400
commit8217d146ab98a1790349d79c436176658e311e3c (patch)
tree7bc6d2e849a0d9bdcc31dc84fec9a2e9f4c882e3 /fs
parente50a26dc785f12a6df1f1ac16d62faf0342b72af (diff)
NFSD: Add support for NFS v4.2 operation checking
The server does allow NFS over v4.2, even if it doesn't add any new operations yet. I also switch to using constants to represent the last operation for each minor version since this makes the code cleaner and easier to understand at a quick glance. Signed-off-by: Anna Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4xdr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 99bebea20668..83db5a742aa9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1585,11 +1585,13 @@ static nfsd4_dec nfsd4_dec_ops[] = {
1585static inline bool 1585static inline bool
1586nfsd4_opnum_in_range(struct nfsd4_compoundargs *argp, struct nfsd4_op *op) 1586nfsd4_opnum_in_range(struct nfsd4_compoundargs *argp, struct nfsd4_op *op)
1587{ 1587{
1588 if (op->opnum < FIRST_NFS4_OP || op->opnum > LAST_NFS4_OP) 1588 if (op->opnum < FIRST_NFS4_OP)
1589 return false; 1589 return false;
1590 else if (argp->minorversion == 0 && op->opnum > OP_RELEASE_LOCKOWNER) 1590 else if (argp->minorversion == 0 && op->opnum > LAST_NFS40_OP)
1591 return false; 1591 return false;
1592 else if (argp->minorversion == 1 && op->opnum > OP_RECLAIM_COMPLETE) 1592 else if (argp->minorversion == 1 && op->opnum > LAST_NFS41_OP)
1593 return false;
1594 else if (argp->minorversion == 2 && op->opnum > LAST_NFS42_OP)
1593 return false; 1595 return false;
1594 return true; 1596 return true;
1595} 1597}