OSDN Git Service

ecryptfs: implement get acl method
authorChristian Brauner <brauner@kernel.org>
Thu, 22 Sep 2022 15:17:17 +0000 (17:17 +0200)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Thu, 20 Oct 2022 08:13:30 +0000 (10:13 +0200)
commitaf84016f1cfe78b23c8efbf6ba5c3c660d52a9ee
treea39f7be61503f49a88312acd784dbe456dfe7f08
parentb82784a2f52a7a2a5491d36f0c257cf64d87abb5
ecryptfs: implement 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].

In order to build a type safe posix api around get and set acl we need
all filesystem to implement get and set acl.

So far ecryptfs didn't implement get and set acl inode operations
because it wanted easy access to the dentry. Now that we extended the
set acl inode operation to take a dentry argument and added a new get
acl inode operation that takes a dentry argument we can let ecryptfs
implement get and set acl inode operations.

Note, until the vfs has been switched to the new posix acl api this
patch is a non-functional change.

Link: https://lore.kernel.org/all/20220801145520.1532837-1-brauner@kernel.org
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
fs/ecryptfs/inode.c