diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c4b10a1e6c30..f6744bc03dae 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1157,14 +1157,19 @@ find_file(struct inode *ino) | |||
1157 | return NULL; | 1157 | return NULL; |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | static int access_valid(u32 x) | 1160 | static inline int access_valid(u32 x) |
1161 | { | 1161 | { |
1162 | return (x > 0 && x < 4); | 1162 | if (x < NFS4_SHARE_ACCESS_READ) |
1163 | return 0; | ||
1164 | if (x > NFS4_SHARE_ACCESS_BOTH) | ||
1165 | return 0; | ||
1166 | return 1; | ||
1163 | } | 1167 | } |
1164 | 1168 | ||
1165 | static int deny_valid(u32 x) | 1169 | static inline int deny_valid(u32 x) |
1166 | { | 1170 | { |
1167 | return (x >= 0 && x < 5); | 1171 | /* Note: unlike access bits, deny bits may be zero. */ |
1172 | return x <= NFS4_SHARE_DENY_BOTH; | ||
1168 | } | 1173 | } |
1169 | 1174 | ||
1170 | static void | 1175 | static void |