Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 May 2009 22:21:55 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192861 - in head/sys/fs: nfs nfsserver
Message-ID:  <200905262221.n4QMLt46075555@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue May 26 22:21:53 2009
New Revision: 192861
URL: http://svn.freebsd.org/changeset/base/192861

Log:
  Fix the experimental nfs subsystem so that it builds with the
  current NFSv4 ACLs, as defined in sys/acl.h. It still needs a
  way to test a mount point for NFSv4 ACL support before it will
  work. Until then, the NFSHASNFS4ACL() macro just always returns 0.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/fs/nfs/nfs_commonacl.c
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: head/sys/fs/nfs/nfs_commonacl.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonacl.c	Tue May 26 21:40:15 2009	(r192860)
+++ head/sys/fs/nfs/nfs_commonacl.c	Tue May 26 22:21:53 2009	(r192861)
@@ -224,7 +224,7 @@ nfsrv_acemasktoperm(u_int32_t acetype, u
 	}
 	if (mask & NFSV4ACE_SEARCH) {
 		mask &= ~NFSV4ACE_SEARCH;
-		perm |= ACL_SEARCH;
+		perm |= ACL_EXECUTE;
 	}
 	if (mask & NFSV4ACE_DELETECHILD) {
 		mask &= ~NFSV4ACE_DELETECHILD;
@@ -505,7 +505,7 @@ nfsrv_buildace(struct nfsrv_descript *nd
 			acemask |= NFSV4ACE_READNAMEDATTR;
 		if (ace->ae_perm & ACL_WRITE_NAMED_ATTRS)
 			acemask |= NFSV4ACE_WRITENAMEDATTR;
-		if (ace->ae_perm & ACL_SEARCH)
+		if (ace->ae_perm & ACL_EXECUTE)
 			acemask |= NFSV4ACE_SEARCH;
 		if (ace->ae_perm & ACL_DELETE_CHILD)
 			acemask |= NFSV4ACE_DELETECHILD;

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Tue May 26 21:40:15 2009	(r192860)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Tue May 26 22:21:53 2009	(r192861)
@@ -1018,7 +1018,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd
 			    if (nfsrv_useacl) {
 				NFSACL_T *naclp;
 
-				naclp = acl_alloc();
+				naclp = acl_alloc(M_WAITOK);
 				error = nfsrv_dissectacl(nd, naclp, &aceerr,
 				    &cnt, p);
 				if (error) {
@@ -1933,7 +1933,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
 	} else {
 		NFSCLRNOTFILLABLE_ATTRBIT(retbitp);
 #ifdef NFS4_ACL_EXTATTR_NAME
-		naclp = acl_alloc();
+		naclp = acl_alloc(M_WAITOK);
 #endif
 		aclp = naclp;
 	}

Modified: head/sys/fs/nfs/nfsport.h
==============================================================================
--- head/sys/fs/nfs/nfsport.h	Tue May 26 21:40:15 2009	(r192860)
+++ head/sys/fs/nfs/nfsport.h	Tue May 26 22:21:53 2009	(r192861)
@@ -71,8 +71,6 @@
 #include <sys/bio.h>
 #include <sys/buf.h>
 #include <sys/acl.h>
-/* until the nfsv4 acl stuff is all committed, undef NFS4_ACL_EXTATTR_NAME */
-#undef NFS4_ACL_EXTATTR_NAME
 #include <sys/module.h>
 #include <sys/sysent.h>
 #include <sys/syscall.h>
@@ -789,7 +787,7 @@ void newnfs_realign(struct mbuf **);
 #define	NFSSETWRITEVERF(n)	((n)->nm_state |= NFSSTA_HASWRITEVERF)
 #define	NFSSETHASSETFSID(n)	((n)->nm_state |= NFSSTA_HASSETFSID)
 #ifdef NFS4_ACL_EXTATTR_NAME
-#define	NFSHASNFS4ACL(m)	((m)->mnt_flag & MNT_NFS4ACLS)
+#define	NFSHASNFS4ACL(m)	0
 #else
 #define	NFSHASNFS4ACL(m)	0
 #endif

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Tue May 26 21:40:15 2009	(r192860)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Tue May 26 22:21:53 2009	(r192861)
@@ -187,7 +187,11 @@ nfsvno_accchk(struct vnode *vp, u_int32_
 	if (vpislocked == 0)
 		NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p);
 
-#ifdef NFS4_ACL_EXTATTR_NAME
+#if defined(NFS4_ACL_EXTATTR_NAME) && defined(notyet)
+	/*
+	 * This function should be called once FFS has NFSv4 ACL support
+	 * in it.
+	 */
 	/*
 	 * Should the override still be applied when ACLs are enabled?
 	 */

Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdserv.c	Tue May 26 21:40:15 2009	(r192860)
+++ head/sys/fs/nfsserver/nfs_nfsdserv.c	Tue May 26 22:21:53 2009	(r192861)
@@ -237,7 +237,7 @@ nfsrvd_setattr(struct nfsrv_descript *nd
 		return (0);
 	}
 #ifdef NFS4_ACL_EXTATTR_NAME
-	aclp = acl_alloc();
+	aclp = acl_alloc(M_WAITOK);
 	aclp->acl_cnt = 0;
 #endif
 	NFSVNO_ATTRINIT(&nva);
@@ -1041,7 +1041,7 @@ nfsrvd_mknod(struct nfsrv_descript *nd, 
 		return (0);
 	}
 #ifdef NFS4_ACL_EXTATTR_NAME
-	aclp = acl_alloc();
+	aclp = acl_alloc(M_WAITOK);
 	aclp->acl_cnt = 0;
 #endif
 
@@ -2418,7 +2418,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _
 	NFSACL_T *aclp = NULL;
 
 #ifdef NFS4_ACL_EXTATTR_NAME
-	aclp = acl_alloc();
+	aclp = acl_alloc(M_WAITOK);
 	aclp->acl_cnt = 0;
 #endif
 	NFSZERO_ATTRBIT(&attrbits);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905262221.n4QMLt46075555>