Lines 279-285
Link Here
|
279 |
name = PVFS2_XATTR_NAME_ACL_ACCESS; |
279 |
name = PVFS2_XATTR_NAME_ACL_ACCESS; |
280 |
if (acl) |
280 |
if (acl) |
281 |
{ |
281 |
{ |
282 |
mode_t mode = inode->i_mode; |
282 |
umode_t mode = inode->i_mode; |
283 |
/* can we represent this with the UNIXy permission bits? */ |
283 |
/* can we represent this with the UNIXy permission bits? */ |
284 |
error = posix_acl_equiv_mode(acl, &mode); |
284 |
error = posix_acl_equiv_mode(acl, &mode); |
285 |
/* uh oh some error.. */ |
285 |
/* uh oh some error.. */ |
Lines 603-610
Link Here
|
603 |
} |
603 |
} |
604 |
if (get_acl_flag(inode) == 1 && acl) |
604 |
if (get_acl_flag(inode) == 1 && acl) |
605 |
{ |
605 |
{ |
606 |
struct posix_acl *clone; |
606 |
/* struct posix_acl *clone; |
607 |
mode_t mode; |
607 |
mode_t mode; */ |
|
|
608 |
umode_t mode = inode->i_mode; |
608 |
|
609 |
|
609 |
if (S_ISDIR(inode->i_mode)) |
610 |
if (S_ISDIR(inode->i_mode)) |
610 |
{ |
611 |
{ |
Lines 616-630
Link Here
|
616 |
goto cleanup; |
617 |
goto cleanup; |
617 |
} |
618 |
} |
618 |
} |
619 |
} |
619 |
clone = posix_acl_clone(acl, GFP_KERNEL); |
620 |
/* clone = posix_acl_clone(acl, GFP_KERNEL); |
620 |
error = -ENOMEM; |
621 |
error = -ENOMEM; |
621 |
if (!clone) { |
622 |
if (!clone) { |
622 |
gossip_err("posix_acl_clone failed with ENOMEM\n"); |
623 |
gossip_err("posix_acl_clone failed with ENOMEM\n"); |
623 |
ClearModeFlag(pvfs2_inode); |
624 |
ClearModeFlag(pvfs2_inode); |
624 |
goto cleanup; |
625 |
goto cleanup; |
625 |
} |
626 |
} */ |
626 |
mode = inode->i_mode; |
627 |
/* mode = inode->i_mode; |
627 |
error = posix_acl_create_masq(clone, &mode); |
628 |
error = posix_acl_create_masq(clone, &mode); */ |
|
|
629 |
error = posix_acl_create(&acl, GFP_KERNEL, &mode); |
628 |
if (error >= 0) |
630 |
if (error >= 0) |
629 |
{ |
631 |
{ |
630 |
gossip_debug(GOSSIP_ACL_DEBUG, "posix_acl_create_masq changed mode " |
632 |
gossip_debug(GOSSIP_ACL_DEBUG, "posix_acl_create_masq changed mode " |
Lines 641-651
Link Here
|
641 |
*/ |
643 |
*/ |
642 |
if (error > 0) |
644 |
if (error > 0) |
643 |
{ |
645 |
{ |
644 |
error = pvfs2_set_acl(inode, ACL_TYPE_ACCESS, clone); |
646 |
error = pvfs2_set_acl(inode, ACL_TYPE_ACCESS, acl); |
645 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_set_acl (access) returned %d\n", error); |
647 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_set_acl (access) returned %d\n", error); |
646 |
} |
648 |
} |
647 |
} |
649 |
} |
648 |
posix_acl_release(clone); |
650 |
/* posix_acl_release(clone); */ |
|
|
651 |
posix_acl_release(acl); |
649 |
} |
652 |
} |
650 |
/* If mode of the inode was changed, then do a forcible ->setattr */ |
653 |
/* If mode of the inode was changed, then do a forcible ->setattr */ |
651 |
if (ModeFlag(pvfs2_inode)) |
654 |
if (ModeFlag(pvfs2_inode)) |
Lines 664-670
Link Here
|
664 |
*/ |
667 |
*/ |
665 |
int pvfs2_acl_chmod(struct inode *inode) |
668 |
int pvfs2_acl_chmod(struct inode *inode) |
666 |
{ |
669 |
{ |
667 |
struct posix_acl *acl, *clone; |
670 |
/* struct posix_acl *acl, *clone; */ |
|
|
671 |
struct posix_acl *acl; |
668 |
int error; |
672 |
int error; |
669 |
|
673 |
|
670 |
if (get_acl_flag(inode) == 0) |
674 |
if (get_acl_flag(inode) == 0) |
Lines 691-712
Link Here
|
691 |
error = 0; |
695 |
error = 0; |
692 |
goto out; |
696 |
goto out; |
693 |
} |
697 |
} |
694 |
clone = posix_acl_clone(acl, GFP_KERNEL); |
698 |
/* clone = posix_acl_clone(acl, GFP_KERNEL); |
695 |
posix_acl_release(acl); |
699 |
posix_acl_release(acl); */ |
696 |
if (!clone) |
700 |
/*if (!clone) |
697 |
{ |
701 |
{ |
698 |
gossip_err("pvfs2_acl_chmod failed with ENOMEM\n"); |
702 |
gossip_err("pvfs2_acl_chmod failed with ENOMEM\n"); |
699 |
error = -ENOMEM; |
703 |
error = -ENOMEM; |
700 |
goto out; |
704 |
goto out; |
701 |
} |
705 |
} */ |
702 |
error = posix_acl_chmod_masq(clone, inode->i_mode); |
706 |
|
|
|
707 |
error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); |
703 |
if (!error) |
708 |
if (!error) |
704 |
{ |
709 |
{ |
705 |
error = pvfs2_set_acl(inode, ACL_TYPE_ACCESS, clone); |
710 |
error = pvfs2_set_acl(inode, ACL_TYPE_ACCESS, acl); |
706 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_acl_chmod: pvfs2 set acl " |
711 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_acl_chmod: pvfs2 set acl " |
707 |
"(access) returned %d\n", error); |
712 |
"(access) returned %d\n", error); |
708 |
} |
713 |
} |
709 |
posix_acl_release(clone); |
714 |
posix_acl_release(acl); |
710 |
out: |
715 |
out: |
711 |
return error; |
716 |
return error; |
712 |
} |
717 |
} |
Lines 763-773
Link Here
|
763 |
#ifdef HAVE_GENERIC_PERMISSION |
768 |
#ifdef HAVE_GENERIC_PERMISSION |
764 |
int ret; |
769 |
int ret; |
765 |
|
770 |
|
766 |
ret = generic_permission(inode, mask, |
771 |
/* see include/linux/fs.h : kernel 2.6 3 params, |
|
|
772 |
* 3.0 4 params, 3.1 and 3.2 2 params */ |
773 |
ret = generic_permission(inode, mask |
767 |
#ifdef HAVE_FOUR_PARAM_GENERIC_PERMISSION |
774 |
#ifdef HAVE_FOUR_PARAM_GENERIC_PERMISSION |
768 |
0, |
775 |
,0 |
769 |
#endif /* HAVE_FOUR_PARAM_GENERIC_PERMISSION */ |
776 |
#endif /* HAVE_FOUR_PARAM_GENERIC_PERMISSION */ |
770 |
pvfs2_check_acl); |
777 |
#ifdef HAVE_THREE_PARAM_GENERIC_PERMISSION |
|
|
778 |
,pvfs2_check_acl |
779 |
#endif /* HAVE_THREE_PARAM_GENERIC_PERMISSION */ |
780 |
); |
771 |
if (ret != 0) |
781 |
if (ret != 0) |
772 |
{ |
782 |
{ |
773 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_permission failed: inode: %llu mask = %o" |
783 |
gossip_debug(GOSSIP_ACL_DEBUG, "pvfs2_permission failed: inode: %llu mask = %o" |