From owner-svn-src-all@FreeBSD.ORG Sun Jan 31 02:11:14 2010 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 894AC1065693; Sun, 31 Jan 2010 02:11:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76F168FC16; Sun, 31 Jan 2010 02:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0V2BEuY075711; Sun, 31 Jan 2010 02:11:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0V2BEmY075710; Sun, 31 Jan 2010 02:11:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001310211.o0V2BEmY075710@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 31 Jan 2010 02:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203264 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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: Sun, 31 Jan 2010 02:11:14 -0000 Author: trasz Date: Sun Jan 31 02:11:14 2010 New Revision: 203264 URL: http://svn.freebsd.org/changeset/base/203264 Log: MFC r196949: Enable NFSv4 ACL support in ZFS. MFC r197435: In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result in EINVAL, not EOPNOTSUPP. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Jan 31 01:30:51 2010 (r203263) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Jan 31 02:11:14 2010 (r203264) @@ -3851,7 +3851,15 @@ zfs_pathconf(vnode_t *vp, int cmd, ulong #endif case _PC_ACL_EXTENDED: - *valp = 0; /* TODO */ + *valp = 0; + return (0); + + case _PC_ACL_NFS4: + *valp = 1; + return (0); + + case _PC_ACL_PATH_MAX: + *valp = ACL_MAX_ENTRIES; return (0); case _PC_MIN_HOLE_SIZE: @@ -4471,6 +4479,26 @@ zfs_freebsd_pathconf(ap) return (error); } +static int +zfs_freebsd_fifo_pathconf(ap) + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + register_t *a_retval; + } */ *ap; +{ + + switch (ap->a_name) { + case _PC_ACL_EXTENDED: + case _PC_ACL_NFS4: + case _PC_ACL_PATH_MAX: + case _PC_MAC_PRESENT: + return (zfs_freebsd_pathconf(ap)); + default: + return (fifo_specops.vop_pathconf(ap)); + } +} + /* * FreeBSD's extended attributes namespace defines file name prefix for ZFS' * extended attribute name: @@ -4865,7 +4893,7 @@ zfs_freebsd_getacl(ap) vsecattr_t vsecattr; if (ap->a_type != ACL_TYPE_NFS4) - return (EOPNOTSUPP); + return (EINVAL); vsecattr.vsa_mask = VSA_ACE | VSA_ACECNT; if (error = zfs_getsecattr(ap->a_vp, &vsecattr, 0, ap->a_cred, NULL)) @@ -4894,13 +4922,13 @@ zfs_freebsd_setacl(ap) aclent_t *aaclp; if (ap->a_type != ACL_TYPE_NFS4) - return (EOPNOTSUPP); + return (EINVAL); if (ap->a_aclp->acl_cnt < 1 || ap->a_aclp->acl_cnt > MAX_ACL_ENTRIES) return (EINVAL); /* - * With NFS4 ACLs, chmod(2) may need to add additional entries, + * With NFSv4 ACLs, chmod(2) may need to add additional entries, * splitting every entry into two and appending "canonical six" * entries at the end. Don't allow for setting an ACL that would * cause chmod(2) to run out of ACL entries. @@ -4974,11 +5002,9 @@ struct vop_vector zfs_vnodeops = { .vop_deleteextattr = zfs_deleteextattr, .vop_setextattr = zfs_setextattr, .vop_listextattr = zfs_listextattr, -#ifdef notyet .vop_getacl = zfs_freebsd_getacl, .vop_setacl = zfs_freebsd_setacl, .vop_aclcheck = zfs_freebsd_aclcheck, -#endif }; struct vop_vector zfs_fifoops = { @@ -4991,10 +5017,9 @@ struct vop_vector zfs_fifoops = { .vop_reclaim = zfs_freebsd_reclaim, .vop_setattr = zfs_freebsd_setattr, .vop_write = VOP_PANIC, + .vop_pathconf = zfs_freebsd_fifo_pathconf, .vop_fid = zfs_freebsd_fid, -#ifdef notyet .vop_getacl = zfs_freebsd_getacl, .vop_setacl = zfs_freebsd_setacl, .vop_aclcheck = zfs_freebsd_aclcheck, -#endif };