PERFORCE change 171951 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Dec 19 10:46:38 UTC 2009


http://p4web.freebsd.org/chv.cgi?CH=171951

Change 171951 by trasz at trasz_victim on 2009/12/19 10:45:51

	Add change somehow missed when moving permission check from kern/vfs_acl.c
	into VOP_GETACL().

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_vnops.c#35 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_vnops.c#35 (text+ko) ====

@@ -308,8 +308,8 @@
 {
 	struct vnode *vp = ap->a_vp;
 	struct inode *ip = VTOI(vp);
+	accmode_t accmode = ap->a_accmode;
 	int error;
-	accmode_t accmode = ap->a_accmode;
 #ifdef QUOTA
 	int relocked;
 #endif
@@ -385,7 +385,10 @@
 			type = ACL_TYPE_ACCESS;
 
 		acl = acl_alloc(M_WAITOK);
-		error = VOP_GETACL(vp, type, acl, ap->a_cred, ap->a_td);
+		if (type == ACL_TYPE_NFS4)
+			error = ufs_getacl_nfs4_internal(vp, acl, ap->a_td);
+		else
+			error = VOP_GETACL(vp, type, acl, ap->a_cred, ap->a_td);
 		switch (error) {
 		case 0:
 			if (type == ACL_TYPE_NFS4) {
@@ -690,22 +693,19 @@
 	struct acl *aclp;
 
 	aclp = acl_alloc(M_WAITOK);
-
-	error = VOP_GETACL(vp, ACL_TYPE_NFS4, aclp, cred, td);
+	error = ufs_getacl_nfs4_internal(vp, aclp, td);
 	/*
-	 * We cannot get EOPNOTSUPP here, as the filesystem claims
-	 * to support ACLs.
+	 * We don't have to handle EOPNOTSUPP here, as the filesystem claims
+	 * it supports ACLs.
 	 */
 	if (error)
 		goto out;
 
 	acl_nfs4_sync_acl_from_mode(aclp, mode, file_owner_id);
-
-	error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, td);
+	error = ufs_setacl_nfs4_internal(vp, aclp, td);
 
 out:
 	acl_free(aclp);
-
 	return (error);
 }
 #endif /* UFS_ACL */
@@ -1480,17 +1480,14 @@
 	parent_aclp = acl_alloc(M_WAITOK);
 	child_aclp = acl_alloc(M_WAITOK | M_ZERO);
 
-	error = VOP_GETACL(dvp, ACL_TYPE_NFS4, parent_aclp, cred, td);
+	error = ufs_getacl_nfs4_internal(dvp, parent_aclp, td);
 	if (error)
 		goto out;
-
 	acl_nfs4_compute_inherited_acl(parent_aclp, child_aclp,
 	    child_mode, VTOI(tvp)->i_uid, tvp->v_type == VDIR);
-
-	error = VOP_SETACL(tvp, ACL_TYPE_NFS4, child_aclp, cred, td);
+	error = ufs_setacl_nfs4_internal(tvp, child_aclp, td);
 	if (error)
 		goto out;
-
 out:
 	acl_free(parent_aclp);
 	acl_free(child_aclp);


More information about the p4-projects mailing list