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