Explorar o código

nfsd4: mask out non-access bits in nfs4_access_to_omode

This fixes an unnecessary BUG().

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
J. Bruce Fields %!s(int64=15) %!d(string=hai) anos
pai
achega
8f34a430ac
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      fs/nfsd/nfs4state.c

+ 1 - 1
fs/nfsd/nfs4state.c

@@ -440,7 +440,7 @@ test_share(struct nfs4_stateid *stp, struct nfsd4_open *open) {
 
 static int nfs4_access_to_omode(u32 access)
 {
-	switch (access) {
+	switch (access & NFS4_SHARE_ACCESS_BOTH) {
 	case NFS4_SHARE_ACCESS_READ:
 		return O_RDONLY;
 	case NFS4_SHARE_ACCESS_WRITE: