Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 411173 | Differences between
and this patch

Collapse All | Expand All

(-)orangefs-2.8.5//src/kernel/linux-2.6/acl.c (-20 / +30 lines)
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"
(-)orangefs-2.8.5//src/kernel/linux-2.6/inode.c (-1 / +1 lines)
Lines 628-634 Link Here
628
	    inode->i_fop = &pvfs2_dir_operations;
628
	    inode->i_fop = &pvfs2_dir_operations;
629
629
630
	    /* dir inodes start with i_nlink == 2 (for "." entry) */
630
	    /* dir inodes start with i_nlink == 2 (for "." entry) */
631
	    inode->i_nlink++;
631
	    inc_nlink(inode);
632
        }
632
        }
633
        else
633
        else
634
        {
634
        {
(-)orangefs-2.8.5//src/kernel/linux-2.6/namei.c (-2 / +2 lines)
Lines 263-269 Link Here
263
    if (ret == 0)
263
    if (ret == 0)
264
    {
264
    {
265
        pvfs2_inode_t *dir_pinode = PVFS2_I(dir);
265
        pvfs2_inode_t *dir_pinode = PVFS2_I(dir);
266
        inode->i_nlink--;
266
        drop_nlink(inode);
267
267
268
        SetMtimeFlag(dir_pinode);
268
        SetMtimeFlag(dir_pinode);
269
        pvfs2_update_inode_time(dir);
269
        pvfs2_update_inode_time(dir);
Lines 372-378 Link Here
372
    if (ret == 0)
372
    if (ret == 0)
373
    {
373
    {
374
        pvfs2_inode_t *dir_pinode = PVFS2_I(dir);
374
        pvfs2_inode_t *dir_pinode = PVFS2_I(dir);
375
        inode->i_nlink--; 
375
        drop_nlink(inode); 
376
#if 0
376
#if 0
377
        /* NOTE: we have no good way to keep nlink consistent for directories
377
        /* NOTE: we have no good way to keep nlink consistent for directories
378
         * across clients; keep constant at 1  -Phil
378
         * across clients; keep constant at 1  -Phil
(-)orangefs-2.8.5//src/kernel/linux-2.6/pvfs2-utils.c (-1 / +1 lines)
Lines 285-291 Link Here
285
                 * directories across clients; keep constant at 1.  Why 1?  If
285
                 * directories across clients; keep constant at 1.  Why 1?  If
286
                 * we go with 2, then find(1) gets confused and won't work
286
                 * we go with 2, then find(1) gets confused and won't work
287
                 * properly withouth the -noleaf option */
287
                 * properly withouth the -noleaf option */
288
                inode->i_nlink = 1;
288
                set_nlink(inode, 1);
289
                ret = 0;
289
                ret = 0;
290
                break;
290
                break;
291
            case PVFS_TYPE_SYMLINK:
291
            case PVFS_TYPE_SYMLINK:

Return to bug 411173