[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230125-fs-acl-remove-generic-xattr-handlers-v2-0-214cfb88bb56@kernel.org>
Date: Mon, 30 Jan 2023 17:41:56 +0100
From: Christian Brauner <brauner@...nel.org>
To: linux-fsdevel@...r.kernel.org, Christoph Hellwig <hch@....de>
Cc: Al Viro <viro@...iv.linux.org.uk>,
Seth Forshee <sforshee@...nel.org>,
"Christian Brauner (Microsoft)" <brauner@...nel.org>,
linux-f2fs-devel@...ts.sourceforge.net,
linux-erofs@...ts.ozlabs.org, linux-ext4@...r.kernel.org,
linux-mtd@...ts.infradead.org, reiserfs-devel@...r.kernel.org
Subject: [PATCH v2 0/8] acl: remove generic posix acl handlers from all
xattr handlers
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 handler registered at sb->s_xattr for two reasons.
First, because a few filesystems rely on the ->list() method of the
generic POSIX ACL xattr handlers in their ->listxattr() inode operation.
Second, during inode initalization in inode_init_always() the registered
xattr handlers in sb->s_xattr are used to raise IOP_XATTR in
inode->i_opflags.
This series adresses both issues and 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. They are never used apart
from the two cases above.
To fix this we make POSIX ACLs independent of IOP_XATTR. For filesystems
like btrfs or reiserfs that want to disable xattrs and POSIX ACLs for
some inodes we give them a dedicated IOP_NOACL flag they can raise as
discussed in the previous iteration.
The series also simplifies a the ->listxattr() implementation for all
filesystems that rely on the ->list() method of the xattr handlers.
After this we've removed the generic POSIX ACL xattr handlers completely
from sb->s_xattr.
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
[1]: https://lore.kernel.org/lkml/20230125100040.374709-1-brauner@kernel.org
[2]: ssh://git@...olite.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping.git tags/fs.acl.remove.generic.xattr.handlers.v1
Signed-off-by: Christian Brauner (Microsoft) <brauner@...nel.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 (8):
fs: don't use IOP_XATTR for posix acls
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
fs/9p/xattr.c | 4 --
fs/bad_inode.c | 3 +-
fs/btrfs/inode.c | 2 +-
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/libfs.c | 3 +-
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 | 4 +-
fs/overlayfs/super.c | 8 ----
fs/posix_acl.c | 53 +++++++++++++++++----
fs/reiserfs/inode.c | 2 +-
fs/reiserfs/namei.c | 4 +-
fs/reiserfs/reiserfs.h | 2 +-
fs/reiserfs/xattr.c | 74 +++++++++++++++--------------
fs/xattr.c | 101 +++++++++++++++-------------------------
fs/xfs/xfs_xattr.c | 4 --
include/linux/fs.h | 1 +
include/linux/posix_acl.h | 7 +++
include/linux/posix_acl_xattr.h | 5 +-
include/linux/xattr.h | 30 +++++++++++-
mm/shmem.c | 4 --
37 files changed, 245 insertions(+), 256 deletions(-)
---
base-commit: ab072681eabe1ce0a9a32d4baa1a27a2d046bc4a
change-id: 20230125-fs-acl-remove-generic-xattr-handlers-4cfed8558d88
Powered by blists - more mailing lists