Re: generic_permission() optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 7 Nov 2024 at 12:22, Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
>
> How about filesystems maintaing a flag: IOP_EVERYONECANTRAREVERSE?

It's actually just easier if a filesystem just does

        cache_no_acl(inode);

in its read-inode function if it knows it has no ACL's.

Some filesystems already do that, eg btrfs has

        /*
         * try to precache a NULL acl entry for files that don't have
         * any xattrs or acls
         */
        ....
        if (!maybe_acls)
                cache_no_acl(inode);

in btrfs_read_locked_inode(). If that 'maybe' is just reliable enough,
that's all it takes.

I tried to do the same thing for ext4, and failed miserably, but
that's probably because my logic for "maybe_acls" was broken since I'm
not familiar enough with ext4 at that level, and I made it do just

        /* Initialize the "no ACL's" state for the simple cases */
        if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR) && !ei->i_file_acl)
                cache_no_acl(inode);

which doesn't seem to be a strong enough text.

              Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux