From: Christian Brauner <brauner@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org, Seth Forshee <sforshee@digitalocean.com>
Subject: Re: [PATCH 3/6] acl: add vfs_set_acl_prepare()
Date: Fri, 9 Sep 2022 10:03:39 +0200 [thread overview]
Message-ID: <20220909080339.2rdbbk2g2p5evznd@wittgenstein> (raw)
In-Reply-To: <20220906082428.mfcjily4dyefunds@wittgenstein>
On Tue, Sep 06, 2022 at 10:24:32AM +0200, Christian Brauner wrote:
> On Tue, Sep 06, 2022 at 10:15:10AM +0200, Christoph Hellwig wrote:
> > On Tue, Sep 06, 2022 at 10:07:44AM +0200, Christian Brauner wrote:
> > > I've tried switching all filesystem to simply rely on
> > > i_op->{g,s}et_acl() but this doesn't work for at least 9p and cifs
> > > because they need access to the dentry. cifs hasn't even implemented
> > > i_op->get_acl() and I don't think they can because of the lack of a
> > > dentry argument.
> > >
> > > The problem is not just that i_op->{g,s}et_acl() don't take a dentry
> > > argument it's in principle also super annoying to pass it to them
> > > because i_op->get_acl() is used to retrieve POSIX ACLs during permission
> > > checking and thus is called from generic_permission() and thus
> > > inode_permission() and I don't think we want or even can pass down a
> > > dentry everywhere for those. So I stopped short of finishing this
> > > implementation because of that.
> > >
> > > So in order to make this work for cifs and 9p we would probably need a
> > > new i_op method that is separate from the i_op->get_acl() one used in
> > > the acl_permission_check() and friends...
> >
> > Even if we can't use the existing methods, I think adding new
> > set_denstry_acl/get_dentry_acl (or whatever we name them) methods is
> > still better than doing this overload of the xattr methods
> > (just like the uapi overload instead of separate syscalls, but we
> > can't fix that).
>
> Let me explore and see if I can finish the branch using dedicated i_op
> methods instead of updating i_op->get_acl().
>
> I think any data that requires to be interpreteted by the VFS needs to
> have dedicated methods. Seth's branch for example, tries to add
> i_op->{g,s}et_vfs_caps() for vfs caps which also store ownership
> information instead of hacking it through the xattr api like we do now.
I finished a draft of the series. It severly lacks in meangingful commit
messages and I won't be able to finish it before Plumbers next week.
If people want to take a look the branch is available on gitlab and
kernel.org:
https://gitlab.com/brauner/linux/-/commits/fs.posix_acl.vfsuid/
https://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping.git/log/?h=fs.posix_acl.vfsuid
This passes xfstests (ext4, xfs, btrfs, overlayfs with and without
idmapped layers, and LTP). I only needed to add i_op->get_dentry_acl()
as it was possible to adapt ->set_acl() to take a dentry argument and
not an inode argument.
So we have a dedicated POSIX ACL api:
struct posix_acl *vfs_get_acl(struct user_namespace *mnt_userns,
struct dentry *dentry, const char *acl_name)
int vfs_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
const char *acl_name, struct posix_acl *kacl)
int vfs_remove_acl(struct user_namespace *mnt_userns, struct dentry *dentry,
const char *acl_name)
only relying on i_op->get_dentry_acl() and i_op->set_acl() removing the
void * and uapi POSIX ACL abuse completely.
next prev parent reply other threads:[~2022-09-09 8:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 12:38 [PATCH 0/6] acl: rework idmap handling when setting posix acls Christian Brauner
2022-08-29 12:38 ` [PATCH 1/6] ntfs3: rework xattr handlers and switch to POSIX ACL VFS helpers Christian Brauner
2022-08-29 12:44 ` Christian Brauner
2022-08-30 12:51 ` Seth Forshee
2022-08-29 12:38 ` [PATCH 2/6] acl: return EOPNOTSUPP in posix_acl_fix_xattr_common() Christian Brauner
2022-08-30 12:51 ` Seth Forshee
2022-09-06 4:54 ` Christoph Hellwig
2022-08-29 12:38 ` [PATCH 3/6] acl: add vfs_set_acl_prepare() Christian Brauner
2022-08-30 12:55 ` Seth Forshee
2022-09-06 4:57 ` Christoph Hellwig
2022-09-06 7:45 ` Christian Brauner
2022-09-06 7:53 ` Christoph Hellwig
2022-09-06 8:07 ` Christian Brauner
2022-09-06 8:15 ` Christoph Hellwig
2022-09-06 8:24 ` Christian Brauner
2022-09-06 8:28 ` Christoph Hellwig
2022-09-09 8:03 ` Christian Brauner [this message]
2022-09-09 14:58 ` Christoph Hellwig
2022-08-29 12:38 ` [PATCH 4/6] acl: move idmapping handling into posix_acl_xattr_set() Christian Brauner
2022-08-30 12:56 ` Seth Forshee
2022-08-29 12:38 ` [PATCH 5/6] ovl: use vfs_set_acl_prepare() Christian Brauner
2022-08-29 12:46 ` Christian Brauner
2022-08-30 12:56 ` Seth Forshee
2022-08-29 12:38 ` [PATCH 6/6] xattr: constify value argument in vfs_setxattr() Christian Brauner
2022-08-30 12:57 ` Seth Forshee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220909080339.2rdbbk2g2p5evznd@wittgenstein \
--to=brauner@kernel.org \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sforshee@digitalocean.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).