Re: [PATCH 17/27] fs: port ->tmpfile() to pass const mnt_idmap
From: Paul Moore
Date: Wed Sep 02 2026 - 16:15:38 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 +-
> Documentation/filesystems/vfs.rst | 2 +-
> fs/bad_inode.c | 2 +-
> fs/btrfs/inode.c | 2 +-
> fs/ext2/namei.c | 2 +-
> fs/ext4/namei.c | 2 +-
> fs/f2fs/namei.c | 2 +-
> fs/fuse/dir.c | 2 +-
> fs/hugetlbfs/inode.c | 2 +-
> fs/minix/namei.c | 2 +-
> fs/overlayfs/dir.c | 2 +-
> fs/ramfs/inode.c | 2 +-
> fs/smb/client/cifsfs.h | 2 +-
> fs/smb/client/dir.c | 2 +-
> fs/ubifs/dir.c | 2 +-
> fs/udf/namei.c | 2 +-
> fs/xfs/xfs_iops.c | 2 +-
> include/linux/fs.h | 2 +-
> include/linux/lsm_hook_defs.h | 2 +-
> include/linux/security.h | 4 ++--
> mm/shmem.c | 2 +-
> security/integrity/ima/ima_main.c | 2 +-
> security/security.c | 2 +-
> 23 files changed, 24 insertions(+), 24 deletions(-)
Acked-by: Paul Moore <paul@xxxxxxxxxxxxxx> (LSM)
--
paul-moore.com