linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
@ 2023-02-01 13:14 Christian Brauner
  2023-02-01 13:15 ` [PATCH v3 09/10] ovl: check for ->listxattr() support Christian Brauner
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Christian Brauner @ 2023-02-01 13:14 UTC (permalink / raw)
  To: linux-fsdevel, Christoph Hellwig
  Cc: Al Viro, Seth Forshee, Christian Brauner (Microsoft),
	linux-f2fs-devel, linux-erofs, linux-ext4, linux-mtd,
	reiserfs-devel, linux-unionfs

Hey everyone,

After we finished the introduction of the new posix acl api last cycle
we still left the generic POSIX ACL xattr handlers around in the
filesystems xattr handlers for two reasons:

(1) Because a few filesystems rely on the ->list() method of the generic
    POSIX ACL xattr handlers in their ->listxattr() inode operation.
(2) POSIX ACLs are only available if IOP_XATTR is raised. The IOP_XATTR
    flag is raised in inode_init_always() based on whether the
    sb->s_xattr pointer is non-NULL. IOW, the registered xattr handlers
    of the filesystem are used to raise IOP_XATTR.
    If we were to remove the generic POSIX ACL xattr handlers from all
    filesystems we would risk regressing filesystems that only implement
    POSIX ACL support and no other xattrs (nfs3 comes to mind).

This series makes it possible to remove the generic POSIX ACL xattr
handlers from the sb->s_xattr list of all filesystems. This is a crucial
step as the generic POSIX ACL xattr handlers aren't used for POSIX ACLs
anymore and POSIX ACLs don't depend on the xattr infrastructure in a
meaningful way anymore.

Adressing problem (1) will require more work long-term. It would be best
to get rid of the ->list() method of xattr handlers completely if we
can.

For erofs, ext{2,4}, f2fs, jffs2, ocfs2, and reiserfs we keep the dummy
handler around so they can continue to use array-based xattr handler
indexing. The series does simplify the ->listxattr() implementation of
all these filesystems.

This series decouples POSIX ACLs from IOP_XATTR as they don't depend on
xattr handlers anymore. With this we can finally remove the dummy xattr
handlers from all filesystems xattr handlers.

All filesystems with reasonable integration into xfstests have been
tested with:

        ./check -g acl,attr,cap,idmapped,io_uring,perms,unlink

All tests pass without regression on xfstests for-next branch.

Since erofs doesn't have integration into xfstests yet afaict I have
tested it with the testuite available in erofs-utils. They also all pass
without any regressions.

Thanks!
Christian

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
Changes in v3:
- Decouple POSIX ACLs from IOP_XATTR.
- Allow vfs_listxattr() to function without checking for IOP_XATTR
  making it possible to list POSIX ACLs for filesystems that only
  implement POSIX ACLs and no other xattrs.
- Give reiserfs a set of dedicated inode operation for private inodes
  that have turned of xattrs completely.
- Link to v2: https://lore.kernel.org/r/20230125-fs-acl-remove-generic-xattr-handlers-v2-0-214cfb88bb56@kernel.org

Changes in v2:
- Please see changelogs of the individual patches.
- Christoph & Christian:
  Remove SB_I_XATTR and instead introduce IOP_NOACL so filesystems can
  opt out of POSIX ACLs for specific inodes. Decouple POSIX ACLs from
  IOP_XATTR.
- Keep generic posix acl xattr handlers so filesystems that use array
  based indexing on xattr handlers can continue to do so.
- Minor fixes.
- Link to v1: https://lore.kernel.org/r/20230125-fs-acl-remove-generic-xattr-handlers-v1-0-6cf155b492b6@kernel.org

---
Christian Brauner (10):
      xattr: simplify listxattr helpers
      xattr: add listxattr helper
      xattr: remove unused argument
      fs: drop unused posix acl handlers
      fs: simplify ->listxattr() implementation
      reiserfs: rework ->listxattr() implementation
      fs: rename generic posix acl handlers
      reiserfs: rework priv inode handling
      ovl: check for ->listxattr() support
      acl: don't depend on IOP_XATTR

 fs/9p/xattr.c                   |   4 --
 fs/btrfs/xattr.c                |   4 --
 fs/ceph/xattr.c                 |   4 --
 fs/cifs/xattr.c                 |   4 --
 fs/ecryptfs/inode.c             |   4 --
 fs/erofs/xattr.c                |  12 +---
 fs/erofs/xattr.h                |  20 ++++---
 fs/ext2/xattr.c                 |  25 ++++----
 fs/ext4/xattr.c                 |  25 ++++----
 fs/f2fs/xattr.c                 |  24 ++++----
 fs/gfs2/xattr.c                 |   2 -
 fs/jffs2/xattr.c                |  29 +++++-----
 fs/jfs/xattr.c                  |   4 --
 fs/nfs/nfs3_fs.h                |   1 -
 fs/nfs/nfs3acl.c                |   6 --
 fs/nfs/nfs3super.c              |   3 -
 fs/nfsd/nfs4xdr.c               |   3 +-
 fs/ntfs3/xattr.c                |   4 --
 fs/ocfs2/xattr.c                |  14 ++---
 fs/orangefs/xattr.c             |   2 -
 fs/overlayfs/copy_up.c          |   3 +-
 fs/overlayfs/super.c            |   8 ---
 fs/posix_acl.c                  |  61 +++++++++++++++-----
 fs/reiserfs/file.c              |   7 +++
 fs/reiserfs/inode.c             |   6 +-
 fs/reiserfs/namei.c             |  50 ++++++++++++++--
 fs/reiserfs/reiserfs.h          |   2 +
 fs/reiserfs/xattr.c             |  55 +++++++++---------
 fs/xattr.c                      | 124 ++++++++++++++++++++--------------------
 fs/xfs/xfs_xattr.c              |   4 --
 include/linux/posix_acl.h       |   7 +++
 include/linux/posix_acl_xattr.h |   5 +-
 include/linux/xattr.h           |  19 +++++-
 mm/shmem.c                      |   4 --
 34 files changed, 292 insertions(+), 257 deletions(-)
---
base-commit: ab072681eabe1ce0a9a32d4baa1a27a2d046bc4a
change-id: 20230125-fs-acl-remove-generic-xattr-handlers-4cfed8558d88


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 09/10] ovl: check for ->listxattr() support
  2023-02-01 13:14 [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christian Brauner
@ 2023-02-01 13:15 ` Christian Brauner
  2023-02-01 13:30 ` [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christoph Hellwig
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2023-02-01 13:15 UTC (permalink / raw)
  To: linux-fsdevel, Christoph Hellwig
  Cc: Al Viro, Seth Forshee, Christian Brauner (Microsoft), linux-unionfs

We have decoupled vfs_listxattr() from IOP_XATTR. Instead we just need
to check whether inode->i_op->listxattr is implemented.

Cc: linux-unionfs@vger.kernel.org
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
---
Changes in v3:
- Patch introduced.
---
 fs/overlayfs/copy_up.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c
index c14e90764e35..f658cc8ea492 100644
--- a/fs/overlayfs/copy_up.c
+++ b/fs/overlayfs/copy_up.c
@@ -81,8 +81,7 @@ int ovl_copy_xattr(struct super_block *sb, const struct path *oldpath, struct de
 	int error = 0;
 	size_t slen;
 
-	if (!(old->d_inode->i_opflags & IOP_XATTR) ||
-	    !(new->d_inode->i_opflags & IOP_XATTR))
+	if (!old->d_inode->i_op->listxattr || !new->d_inode->i_op->listxattr)
 		return 0;
 
 	list_size = vfs_listxattr(old, NULL, 0);

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
  2023-02-01 13:14 [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christian Brauner
  2023-02-01 13:15 ` [PATCH v3 09/10] ovl: check for ->listxattr() support Christian Brauner
@ 2023-02-01 13:30 ` Christoph Hellwig
  2023-02-01 13:42   ` Christian Brauner
  2023-03-06  9:23 ` Christian Brauner
  2023-04-26 23:07 ` [f2fs-dev] " patchwork-bot+f2fs
  3 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2023-02-01 13:30 UTC (permalink / raw)
  To: Christian Brauner
  Cc: linux-fsdevel, Christoph Hellwig, Al Viro, Seth Forshee,
	linux-f2fs-devel, linux-erofs, linux-ext4, linux-mtd,
	reiserfs-devel, linux-unionfs

This version looks good to me, but I'd really prefer if a reiserfs
insider could look over the reiserfs patches.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
  2023-02-01 13:30 ` [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christoph Hellwig
@ 2023-02-01 13:42   ` Christian Brauner
  2023-03-06  9:26     ` Christian Brauner
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Brauner @ 2023-02-01 13:42 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-fsdevel, Al Viro, Seth Forshee, linux-f2fs-devel,
	linux-erofs, linux-ext4, linux-mtd, reiserfs-devel,
	linux-unionfs

On Wed, Feb 01, 2023 at 02:30:20PM +0100, Christoph Hellwig wrote:
> This version looks good to me, but I'd really prefer if a reiserfs
> insider could look over the reiserfs patches.

I consider this material for v6.4 even with an -rc8 for v6.3. So there's
time but we shouldn't block it on reiserfs. Especially, since it's
marked deprecated.

Fwiw, I've tested reiserfs with xfstests on a kernel with and without
this series applied and there's no regressions. But it's overall pretty
buggy at least according to xfstests. Which is expected, I guess.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
  2023-02-01 13:14 [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christian Brauner
  2023-02-01 13:15 ` [PATCH v3 09/10] ovl: check for ->listxattr() support Christian Brauner
  2023-02-01 13:30 ` [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christoph Hellwig
@ 2023-03-06  9:23 ` Christian Brauner
  2023-04-26 23:07 ` [f2fs-dev] " patchwork-bot+f2fs
  3 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2023-03-06  9:23 UTC (permalink / raw)
  To: linux-fsdevel, Christoph Hellwig, Christian Brauner
  Cc: Al Viro, Seth Forshee, linux-f2fs-devel, linux-erofs, linux-ext4,
	linux-mtd, reiserfs-devel, linux-unionfs

From: Christian Brauner (Microsoft) <brauner@kernel.org>


On Wed, 01 Feb 2023 14:14:51 +0100, Christian Brauner wrote:
> Hey everyone,
> 
> After we finished the introduction of the new posix acl api last cycle
> we still left the generic POSIX ACL xattr handlers around in the
> filesystems xattr handlers for two reasons:
> 
> (1) Because a few filesystems rely on the ->list() method of the generic
>     POSIX ACL xattr handlers in their ->listxattr() inode operation.
> (2) POSIX ACLs are only available if IOP_XATTR is raised. The IOP_XATTR
>     flag is raised in inode_init_always() based on whether the
>     sb->s_xattr pointer is non-NULL. IOW, the registered xattr handlers
>     of the filesystem are used to raise IOP_XATTR.
>     If we were to remove the generic POSIX ACL xattr handlers from all
>     filesystems we would risk regressing filesystems that only implement
>     POSIX ACL support and no other xattrs (nfs3 comes to mind).
> 
> [...]

With v6.3-rc1 out, I've applied this now. Please keep an eye out for any
regressions as this has been a delicate undertaking: 

[01/10] xattr: simplify listxattr helpers
        commit: f2620f166e2a4db08f016b7b30b904ab28c265e4
[02/10] xattr: add listxattr helper
        commit: 2db8a948046cab3a2f707561592906a3d096972f
[03/10] xattr: remove unused argument
        commit: 831be973aa21d1cf8948bf4b1d4e73e6d5d028c0
[04/10] fs: drop unused posix acl handlers
        commit: 0c95c025a02e477b2d112350e1c78bb0cc994c51
[05/10] fs: simplify ->listxattr() implementation
        commit: a5488f29835c0eb5561b46e71c23f6c39aab6c83
[06/10] reiserfs: rework ->listxattr() implementation
        commit: 387b96a5891c075986afbf13e84cba357710068e
[07/10] fs: rename generic posix acl handlers
        commit: d549b741740e63e87e661754e2d1b336fdc51d50
[08/10] reiserfs: rework priv inode handling
        commit: d9f892b9bdc22b12bc960837a09f014d5a324975
[09/10] ovl: check for ->listxattr() support
        commit: a1fbb607340d49f208e90cc0d7bdfff2141cce8d
[10/10] acl: don't depend on IOP_XATTR
        commit: e499214ce3ef50c50522719e753a1ffc928c2ec1

Christian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
  2023-02-01 13:42   ` Christian Brauner
@ 2023-03-06  9:26     ` Christian Brauner
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Brauner @ 2023-03-06  9:26 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-fsdevel, Al Viro, Seth Forshee, linux-f2fs-devel,
	linux-erofs, linux-ext4, linux-mtd, reiserfs-devel,
	linux-unionfs

On Wed, Feb 01, 2023 at 02:42:54PM +0100, Christian Brauner wrote:
> On Wed, Feb 01, 2023 at 02:30:20PM +0100, Christoph Hellwig wrote:
> > This version looks good to me, but I'd really prefer if a reiserfs
> > insider could look over the reiserfs patches.
> 
> I consider this material for v6.4 even with an -rc8 for v6.3. So there's
> time but we shouldn't block it on reiserfs. Especially, since it's
> marked deprecated.

So I've applied this now. If there's still someone interested in
checking the reiserfs bits more than what we did with xfstests they
should please do so. But I don't want to hold up this series waiting for
that to happen.

> 
> Fwiw, I've tested reiserfs with xfstests on a kernel with and without
> this series applied and there's no regressions. But it's overall pretty
> buggy at least according to xfstests. Which is expected, I guess.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [f2fs-dev] [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers
  2023-02-01 13:14 [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christian Brauner
                   ` (2 preceding siblings ...)
  2023-03-06  9:23 ` Christian Brauner
@ 2023-04-26 23:07 ` patchwork-bot+f2fs
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+f2fs @ 2023-04-26 23:07 UTC (permalink / raw)
  To: Christian Brauner
  Cc: linux-fsdevel, hch, linux-unionfs, reiserfs-devel,
	linux-f2fs-devel, linux-mtd, viro, linux-ext4, linux-erofs,
	sforshee

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Christian Brauner (Microsoft) <brauner@kernel.org>:

On Wed, 01 Feb 2023 14:14:51 +0100 you wrote:
> Hey everyone,
> 
> After we finished the introduction of the new posix acl api last cycle
> we still left the generic POSIX ACL xattr handlers around in the
> filesystems xattr handlers for two reasons:
> 
> (1) Because a few filesystems rely on the ->list() method of the generic
>     POSIX ACL xattr handlers in their ->listxattr() inode operation.
> (2) POSIX ACLs are only available if IOP_XATTR is raised. The IOP_XATTR
>     flag is raised in inode_init_always() based on whether the
>     sb->s_xattr pointer is non-NULL. IOW, the registered xattr handlers
>     of the filesystem are used to raise IOP_XATTR.
>     If we were to remove the generic POSIX ACL xattr handlers from all
>     filesystems we would risk regressing filesystems that only implement
>     POSIX ACL support and no other xattrs (nfs3 comes to mind).
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v3,05/10] fs: simplify ->listxattr() implementation
    https://git.kernel.org/jaegeuk/f2fs/c/a5488f29835c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-26 23:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 13:14 [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christian Brauner
2023-02-01 13:15 ` [PATCH v3 09/10] ovl: check for ->listxattr() support Christian Brauner
2023-02-01 13:30 ` [PATCH v3 00/10] acl: drop posix acl handlers from xattr handlers Christoph Hellwig
2023-02-01 13:42   ` Christian Brauner
2023-03-06  9:26     ` Christian Brauner
2023-03-06  9:23 ` Christian Brauner
2023-04-26 23:07 ` [f2fs-dev] " patchwork-bot+f2fs

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).