On Tue 01-09-26 14:14:31, Christian Brauner 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) <[email protected]>
Looks good. Feel free to add: Reviewed-by: Jan Kara <[email protected]> Honza > --- > include/linux/fs.h | 8 ++++---- > security/integrity/evm/evm_main.c | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index cec5de83d882..154f2c976a0a 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -1456,7 +1456,7 @@ static inline vfsuid_t i_uid_into_vfsuid(const struct > mnt_idmap *idmap, > * > * Return: true if @inode's i_uid field needs to be updated, false if not. > */ > -static inline bool i_uid_needs_update(struct mnt_idmap *idmap, > +static inline bool i_uid_needs_update(const struct mnt_idmap *idmap, > const struct iattr *attr, > const struct inode *inode) > { > @@ -1474,7 +1474,7 @@ static inline bool i_uid_needs_update(struct mnt_idmap > *idmap, > * Safely update @inode's i_uid field translating the vfsuid of any idmapped > * mount into the filesystem kuid. > */ > -static inline void i_uid_update(struct mnt_idmap *idmap, > +static inline void i_uid_update(const struct mnt_idmap *idmap, > const struct iattr *attr, > struct inode *inode) > { > @@ -1508,7 +1508,7 @@ static inline vfsgid_t i_gid_into_vfsgid(const struct > mnt_idmap *idmap, > * > * Return: true if @inode's i_gid field needs to be updated, false if not. > */ > -static inline bool i_gid_needs_update(struct mnt_idmap *idmap, > +static inline bool i_gid_needs_update(const struct mnt_idmap *idmap, > const struct iattr *attr, > const struct inode *inode) > { > @@ -1526,7 +1526,7 @@ static inline bool i_gid_needs_update(struct mnt_idmap > *idmap, > * Safely update @inode's i_gid field translating the vfsgid of any idmapped > * mount into the filesystem kgid. > */ > -static inline void i_gid_update(struct mnt_idmap *idmap, > +static inline void i_gid_update(const struct mnt_idmap *idmap, > const struct iattr *attr, > struct inode *inode) > { > diff --git a/security/integrity/evm/evm_main.c > b/security/integrity/evm/evm_main.c > index 66f27653cdac..06e187c9912d 100644 > --- a/security/integrity/evm/evm_main.c > +++ b/security/integrity/evm/evm_main.c > @@ -933,7 +933,7 @@ static inline void evm_inode_post_remove_acl(struct > mnt_idmap *idmap, > evm_inode_post_removexattr(dentry, acl_name); > } > > -static int evm_attr_change(struct mnt_idmap *idmap, > +static int evm_attr_change(const struct mnt_idmap *idmap, > struct dentry *dentry, struct iattr *attr) > { > struct inode *inode = d_backing_inode(dentry); > > -- > 2.53.0 > -- Jan Kara <[email protected]> SUSE Labs, CR

