From owner-svn-src-all@FreeBSD.ORG Tue May 26 22:21:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CEC9106564A; Tue, 26 May 2009 22:21:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABD28FC0A; Tue, 26 May 2009 22:21:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4QMLta3075556; Tue, 26 May 2009 22:21:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4QMLt46075555; Tue, 26 May 2009 22:21:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200905262221.n4QMLt46075555@svn.freebsd.org> From: Rick Macklem Date: Tue, 26 May 2009 22:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192861 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2009 22:21:56 -0000 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 #include #include -/* until the nfsv4 acl stuff is all committed, undef NFS4_ACL_EXTATTR_NAME */ -#undef NFS4_ACL_EXTATTR_NAME #include #include #include @@ -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);