linux-stable/fs/jfs
Christian Brauner cac2f8b8d8
fs: rename current get acl method
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>
2022-10-20 10:13:27 +02:00
..
acl.c fs: pass dentry to set acl method 2022-10-19 12:55:42 +02:00
file.c fs: rename current get acl method 2022-10-20 10:13:27 +02:00
inode.c jfs: stop using the nobh helper 2022-08-02 12:34:04 -04:00
ioctl.c block: add a bdev_discard_granularity helper 2022-04-17 19:49:59 -06:00
jfs_acl.h fs: pass dentry to set acl method 2022-10-19 12:55:42 +02:00
jfs_btree.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_debug.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
jfs_debug.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_dinode.h jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_discard.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_discard.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_dmap.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_dmap.h jfs: Fix array index bounds check in dbAdjTree 2020-11-13 16:03:07 -06:00
jfs_dtree.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_dtree.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_extent.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_extent.h jfs: delete duplicated words + other fixes 2020-11-13 13:36:00 -06:00
jfs_filsys.h JFS: more checks for invalid superblock 2020-12-18 15:23:33 -06:00
jfs_imap.c jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_imap.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_incore.h jfs: Avoid field-overflowing memcpy() 2021-06-23 09:21:52 -05:00
jfs_inode.c inode: make init and permission helpers idmapped mount aware 2021-01-24 14:27:16 +01:00
jfs_inode.h jfs: convert to fileattr 2021-04-12 15:04:29 +02:00
jfs_lock.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_logmgr.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_logmgr.h jfs: delete duplicated words + other fixes 2020-11-13 13:36:00 -06:00
jfs_metapage.c jfs: Remove check for PageUptodate 2022-06-29 08:51:07 -04:00
jfs_metapage.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_mount.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_superblock.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_txnmgr.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_txnmgr.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_types.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_umount.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_unicode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_unicode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_uniupr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
jfs_xattr.h jfs: Replace zero-length array with flexible-array member 2020-03-09 15:18:51 -05:00
jfs_xtree.c fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
jfs_xtree.h fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
Kconfig docs: fix a couple of new broken references 2019-07-31 14:12:26 -06:00
Makefile fs/jfs: Remove dead code 2022-04-25 14:00:33 -05:00
namei.c fs: rename current get acl method 2022-10-20 10:13:27 +02:00
resize.c jfs: use sb_bdev_nr_blocks 2021-10-18 14:43:23 -06:00
super.c block: remove QUEUE_FLAG_DISCARD 2022-04-17 19:49:59 -06:00
symlink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
xattr.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00