aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_acl.c')
-rw-r--r--fs/xfs/xfs_acl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index ebee3a4f703a..3e4648ad9cfc 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -341,8 +341,7 @@ xfs_acl_iaccess(
341 341
342 /* If the file has no ACL return -1. */ 342 /* If the file has no ACL return -1. */
343 rval = sizeof(xfs_acl_t); 343 rval = sizeof(xfs_acl_t);
344 if (xfs_attr_fetch(ip, &acl_name, (char *)acl, &rval, 344 if (xfs_attr_fetch(ip, &acl_name, (char *)acl, &rval, ATTR_ROOT)) {
345 ATTR_ROOT | ATTR_KERNACCESS)) {
346 _ACL_FREE(acl); 345 _ACL_FREE(acl);
347 return -1; 346 return -1;
348 } 347 }
@@ -720,7 +719,7 @@ xfs_acl_setmode(
720 xfs_acl_t *acl, 719 xfs_acl_t *acl,
721 int *basicperms) 720 int *basicperms)
722{ 721{
723 bhv_vattr_t va; 722 struct iattr iattr;
724 xfs_acl_entry_t *ap; 723 xfs_acl_entry_t *ap;
725 xfs_acl_entry_t *gap = NULL; 724 xfs_acl_entry_t *gap = NULL;
726 int i, nomask = 1; 725 int i, nomask = 1;
@@ -734,25 +733,25 @@ xfs_acl_setmode(
734 * Copy the u::, g::, o::, and m:: bits from the ACL into the 733 * Copy the u::, g::, o::, and m:: bits from the ACL into the
735 * mode. The m:: bits take precedence over the g:: bits. 734 * mode. The m:: bits take precedence over the g:: bits.
736 */ 735 */
737 va.va_mask = XFS_AT_MODE; 736 iattr.ia_valid = ATTR_MODE;
738 va.va_mode = xfs_vtoi(vp)->i_d.di_mode; 737 iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode;
739 va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); 738 iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
740 ap = acl->acl_entry; 739 ap = acl->acl_entry;
741 for (i = 0; i < acl->acl_cnt; ++i) { 740 for (i = 0; i < acl->acl_cnt; ++i) {
742 switch (ap->ae_tag) { 741 switch (ap->ae_tag) {
743 case ACL_USER_OBJ: 742 case ACL_USER_OBJ:
744 va.va_mode |= ap->ae_perm << 6; 743 iattr.ia_mode |= ap->ae_perm << 6;
745 break; 744 break;
746 case ACL_GROUP_OBJ: 745 case ACL_GROUP_OBJ:
747 gap = ap; 746 gap = ap;
748 break; 747 break;
749 case ACL_MASK: /* more than just standard modes */ 748 case ACL_MASK: /* more than just standard modes */
750 nomask = 0; 749 nomask = 0;
751 va.va_mode |= ap->ae_perm << 3; 750 iattr.ia_mode |= ap->ae_perm << 3;
752 *basicperms = 0; 751 *basicperms = 0;
753 break; 752 break;
754 case ACL_OTHER: 753 case ACL_OTHER:
755 va.va_mode |= ap->ae_perm; 754 iattr.ia_mode |= ap->ae_perm;
756 break; 755 break;
757 default: /* more than just standard modes */ 756 default: /* more than just standard modes */
758 *basicperms = 0; 757 *basicperms = 0;
@@ -763,9 +762,9 @@ xfs_acl_setmode(
763 762
764 /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ 763 /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */
765 if (gap && nomask) 764 if (gap && nomask)
766 va.va_mode |= gap->ae_perm << 3; 765 iattr.ia_mode |= gap->ae_perm << 3;
767 766
768 return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred); 767 return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred);
769} 768}
770 769
771/* 770/*