Re: [PATCH 13/27] fs: port xattr to const mnt_idmap
From: Paul Moore
Date: Wed Sep 02 2026 - 16:02:22 EST
On Sep 1, 2026 Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> Convert to const struct mnt_idmap.
>
> A mount's idmapping is immutable. The only thing that is allowed to be
> modified afterwards is the reference count and that is hidden behind
> mnt_idmap_get() and mnt_idmap_put(). Everything else only ever reads
> from the idmapping. This is the same model that struct cred uses and the
> idmapping is also rather sensitive.
>
> So make the idmap argument const wherever we can. The conversion is done
> from the bottom up so callers can continue to pass a non-const pointer
> to a const parameter until the conversion is finished.
>
> No functional changes.
>
> Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
> Reviewed-by: Jan Kara <jack@xxxxxxx>
> ---
> Documentation/filesystems/locking.rst | 2 +-
> fs/9p/xattr.c | 2 +-
> fs/afs/xattr.c | 4 ++--
> fs/attr.c | 2 +-
> fs/btrfs/xattr.c | 6 +++---
> fs/ceph/xattr.c | 2 +-
> fs/ecryptfs/inode.c | 2 +-
> fs/ext2/xattr_security.c | 2 +-
> fs/ext2/xattr_trusted.c | 2 +-
> fs/ext2/xattr_user.c | 2 +-
> fs/ext4/xattr_hurd.c | 2 +-
> fs/ext4/xattr_security.c | 2 +-
> fs/ext4/xattr_trusted.c | 2 +-
> fs/ext4/xattr_user.c | 2 +-
> fs/f2fs/xattr.c | 4 ++--
> fs/fuse/dir.c | 2 +-
> fs/fuse/fuse_i.h | 2 +-
> fs/fuse/xattr.c | 2 +-
> fs/gfs2/xattr.c | 2 +-
> fs/hfs/attr.c | 2 +-
> fs/hfsplus/xattr.c | 2 +-
> fs/hfsplus/xattr_security.c | 2 +-
> fs/hfsplus/xattr_trusted.c | 2 +-
> fs/hfsplus/xattr_user.c | 2 +-
> fs/jffs2/security.c | 2 +-
> fs/jffs2/xattr_trusted.c | 2 +-
> fs/jffs2/xattr_user.c | 2 +-
> fs/jfs/xattr.c | 4 ++--
> fs/kernfs/inode.c | 4 ++--
> fs/nfs/nfs4proc.c | 10 +++++-----
> fs/ntfs/ea.c | 2 +-
> fs/ntfs3/xattr.c | 2 +-
> fs/ocfs2/xattr.c | 6 +++---
> fs/orangefs/xattr.c | 2 +-
> fs/overlayfs/xattrs.c | 4 ++--
> fs/pidfs.c | 2 +-
> fs/smb/client/xattr.c | 2 +-
> fs/smb/server/vfs.c | 24 ++++++++++++------------
> fs/smb/server/vfs.h | 20 ++++++++++----------
> fs/ubifs/xattr.c | 2 +-
> fs/xattr.c | 22 +++++++++++-----------
> fs/xfs/xfs_iops.c | 2 +-
> fs/xfs/xfs_xattr.c | 2 +-
> include/linux/capability.h | 4 ++--
> include/linux/fs.h | 2 +-
> include/linux/lsm_hook_defs.h | 8 ++++----
> include/linux/security.h | 20 ++++++++++----------
> include/linux/xattr.h | 20 ++++++++++----------
> kernel/bpf/inode.c | 2 +-
> mm/shmem.c | 2 +-
> net/socket.c | 4 ++--
> security/commoncap.c | 8 ++++----
> security/integrity/evm/evm_main.c | 4 ++--
> security/integrity/ima/ima_appraise.c | 4 ++--
> security/security.c | 8 ++++----
> security/selinux/hooks.c | 6 +++---
> security/smack/smack_lsm.c | 6 +++---
> 57 files changed, 135 insertions(+), 135 deletions(-)
Acked-by: Paul Moore <paul@xxxxxxxxxxxxxx> (LSM, SELinux)
--
paul-moore.com