From 913daf1ec85ce5d4969d371c0ce5128b22c7cd34 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 14 Jan 2008 13:12:19 -0500 Subject: [PATCH] --- yaml --- r: 82445 b: refs/heads/master c: 8838dc43d6544570e8969a74ddc4a0d21abffde6 h: refs/heads/master i: 82443: 84f729161a79f84a677054f4d371c1537dcbc8af v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfs4state.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index ea846fc96aa3..f61561c99eea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b39c18fce003bb2d5a51a4734d8fdd2c81fa1a78 +refs/heads/master: 8838dc43d6544570e8969a74ddc4a0d21abffde6 diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index c4b10a1e6c30..f6744bc03dae 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -1157,14 +1157,19 @@ find_file(struct inode *ino) return NULL; } -static int access_valid(u32 x) +static inline int access_valid(u32 x) { - return (x > 0 && x < 4); + if (x < NFS4_SHARE_ACCESS_READ) + return 0; + if (x > NFS4_SHARE_ACCESS_BOTH) + return 0; + return 1; } -static int deny_valid(u32 x) +static inline int deny_valid(u32 x) { - return (x >= 0 && x < 5); + /* Note: unlike access bits, deny bits may be zero. */ + return x <= NFS4_SHARE_DENY_BOTH; } static void