mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
cac2f8b8d8
The current way of setting and getting posix acls through the generic xattr interface is error prone and type unsafe. The vfs needs to interpret and fixup posix acls before storing or reporting it to userspace. Various hacks exist to make this work. The code is hard to understand and difficult to maintain in it's current form. Instead of making this work by hacking posix acls through xattr handlers we are building a dedicated posix acl api around the get and set inode operations. This removes a lot of hackiness and makes the codepaths easier to maintain. A lot of background can be found in [1]. The current inode operation for getting posix acls takes an inode argument but various filesystems (e.g., 9p, cifs, overlayfs) need access to the dentry. In contrast to the ->set_acl() inode operation we cannot simply extend ->get_acl() to take a dentry argument. The ->get_acl() inode operation is called from: acl_permission_check() -> check_acl() -> get_acl() which is part of generic_permission() which in turn is part of inode_permission(). Both generic_permission() and inode_permission() are called in the ->permission() handler of various filesystems (e.g., overlayfs). So simply passing a dentry argument to ->get_acl() would amount to also having to pass a dentry argument to ->permission(). We should avoid this unnecessary change. So instead of extending the existing inode operation rename it from ->get_acl() to ->get_inode_acl() and add a ->get_acl() method later that passes a dentry argument and which filesystems that need access to the dentry can implement instead of ->get_inode_acl(). Filesystems like cifs which allow setting and getting posix acls but not using them for permission checking during lookup can simply not implement ->get_inode_acl(). This is intended to be a non-functional change. Link: https://lore.kernel.org/all/20220801145520.1532837-1-brauner@kernel.org [1] Suggested-by/Inspired-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org> |
||
---|---|---|
.. | ||
acl.c | ||
file.c | ||
inode.c | ||
ioctl.c | ||
jfs_acl.h | ||
jfs_btree.h | ||
jfs_debug.c | ||
jfs_debug.h | ||
jfs_dinode.h | ||
jfs_discard.c | ||
jfs_discard.h | ||
jfs_dmap.c | ||
jfs_dmap.h | ||
jfs_dtree.c | ||
jfs_dtree.h | ||
jfs_extent.c | ||
jfs_extent.h | ||
jfs_filsys.h | ||
jfs_imap.c | ||
jfs_imap.h | ||
jfs_incore.h | ||
jfs_inode.c | ||
jfs_inode.h | ||
jfs_lock.h | ||
jfs_logmgr.c | ||
jfs_logmgr.h | ||
jfs_metapage.c | ||
jfs_metapage.h | ||
jfs_mount.c | ||
jfs_superblock.h | ||
jfs_txnmgr.c | ||
jfs_txnmgr.h | ||
jfs_types.h | ||
jfs_umount.c | ||
jfs_unicode.c | ||
jfs_unicode.h | ||
jfs_uniupr.c | ||
jfs_xattr.h | ||
jfs_xtree.c | ||
jfs_xtree.h | ||
Kconfig | ||
Makefile | ||
namei.c | ||
resize.c | ||
super.c | ||
symlink.c | ||
xattr.c |