On Tue, Mar 14, 2023 at 12:37:03PM +0000, Matthew Wilcox wrote: > On Tue, Mar 14, 2023 at 12:51:10PM +0100, Christian Brauner wrote: > > +++ b/include/linux/fs.h > > @@ -2675,6 +2675,8 @@ extern struct inode *new_inode(struct super_block *sb); > > extern void free_inode_nonrcu(struct inode *inode); > > extern int setattr_should_drop_suidgid(struct mnt_idmap *, struct inode *); > > extern int file_remove_privs(struct file *); > > +int setattr_should_drop_sgid(struct mnt_idmap *idmap, > > + const struct inode *inode); > > Is there a reason that setattr_should_drop_sgid() doesn't take a > const struct mnt_idmap pointer? Yeah, unfortunately a bunch of helpers that we're passing it down to from setattr_should_drop_sgid() currently take a non-const pointer to mnt_idmap. I have a ToDo that to go through all helpers and make them const wherever we can.