fs: port ->fileattr_set() to pass mnt_idmap
authorChristian Brauner <brauner@kernel.org>
Fri, 13 Jan 2023 11:49:21 +0000 (12:49 +0100)
committerChristian Brauner (Microsoft) <brauner@kernel.org>
Thu, 19 Jan 2023 08:24:27 +0000 (09:24 +0100)
Convert to struct mnt_idmap.

Last cycle we merged the necessary infrastructure in
256c8aed2b42 ("fs: introduce dedicated idmap type for mounts").
This is just the conversion to struct mnt_idmap.

Currently we still pass around the plain namespace that was attached to a
mount. This is in general pretty convenient but it makes it easy to
conflate namespaces that are relevant on the filesystem with namespaces
that are relevent on the mount level. Especially for non-vfs developers
without detailed knowledge in this area this can be a potential source for
bugs.

Once the conversion to struct mnt_idmap is done all helpers down to the
really low-level helpers will take a struct mnt_idmap argument instead of
two namespace arguments. This way it becomes impossible to conflate the two
eliminating the possibility of any bugs. All of the vfs and all filesystems
only operate on struct mnt_idmap.

Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
37 files changed:
Documentation/filesystems/locking.rst
Documentation/filesystems/vfs.rst
fs/btrfs/ioctl.c
fs/btrfs/ioctl.h
fs/ecryptfs/inode.c
fs/efivarfs/inode.c
fs/ext2/ext2.h
fs/ext2/ioctl.c
fs/ext4/ext4.h
fs/ext4/ioctl.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/fuse/fuse_i.h
fs/fuse/ioctl.c
fs/gfs2/file.c
fs/gfs2/inode.h
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/inode.c
fs/ioctl.c
fs/jfs/ioctl.c
fs/jfs/jfs_inode.h
fs/nilfs2/ioctl.c
fs/nilfs2/nilfs.h
fs/ocfs2/ioctl.c
fs/ocfs2/ioctl.h
fs/orangefs/inode.c
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h
fs/reiserfs/ioctl.c
fs/reiserfs/reiserfs.h
fs/ubifs/ioctl.c
fs/ubifs/ubifs.h
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_ioctl.h
include/linux/fileattr.h
include/linux/fs.h
mm/shmem.c

index d42d7b8de2f5b6d03fe40f2d0de9b88bd1d37310..fb23ffc0792c3a59c867fb6d599f204c518acb02 100644 (file)
@@ -81,7 +81,7 @@ prototypes::
                                umode_t create_mode);
        int (*tmpfile) (struct mnt_idmap *, struct inode *,
                        struct file *, umode_t);
-       int (*fileattr_set)(struct user_namespace *mnt_userns,
+       int (*fileattr_set)(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
        int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
        struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
index 19afe53f7060c848cc062b46b18cec167fc1de76..bf5cc9809b65def83d062ba5c073f10dfe09678d 100644 (file)
@@ -445,7 +445,7 @@ As of kernel 2.6.22, the following members are defined:
                int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t);
                struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
                int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
-               int (*fileattr_set)(struct user_namespace *mnt_userns,
+               int (*fileattr_set)(struct mnt_idmap *idmap,
                                    struct dentry *dentry, struct fileattr *fa);
                int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
        };
index 7e348bd2ccdeb39a84ba81ec5e6022e9376aa35e..f23d0d399b9fc6220c0d49798ed04a45fd324121 100644 (file)
@@ -243,7 +243,7 @@ int btrfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int btrfs_fileattr_set(struct user_namespace *mnt_userns,
+int btrfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 8a855d5ac2fa04f31ffee57edf784e3fec4f167f..d51b9a2f2f6e88fa54876e28793def8b2ff483e0 100644 (file)
@@ -6,7 +6,7 @@
 long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 int btrfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int btrfs_fileattr_set(struct user_namespace *mnt_userns,
+int btrfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 int btrfs_ioctl_get_supported_features(void __user *arg);
 void btrfs_sync_inode_flags_to_i_flags(struct inode *inode);
index b62351b7ad6a49fd4095aec4124f963621f21026..133e6c13d9b86a4f71d5c804ae73ee6ce9c1a340 100644 (file)
@@ -1110,13 +1110,13 @@ static int ecryptfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return vfs_fileattr_get(ecryptfs_dentry_to_lower(dentry), fa);
 }
 
-static int ecryptfs_fileattr_set(struct user_namespace *mnt_userns,
+static int ecryptfs_fileattr_set(struct mnt_idmap *idmap,
                                 struct dentry *dentry, struct fileattr *fa)
 {
        struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
        int rc;
 
-       rc = vfs_fileattr_set(&init_user_ns, lower_dentry, fa);
+       rc = vfs_fileattr_set(&nop_mnt_idmap, lower_dentry, fa);
        fsstack_copy_attr_all(d_inode(dentry), d_inode(lower_dentry));
 
        return rc;
index 80369872815f66e7a03cb93c2bfbd19beebb9805..b973a2c03dde825e1bcdada881f04cde6b88a944 100644 (file)
@@ -163,7 +163,7 @@ efivarfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
 }
 
 static int
-efivarfs_fileattr_set(struct user_namespace *mnt_userns,
+efivarfs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        unsigned int i_flags = 0;
index 9ca0fda2892895297c8d8eadcbc2c380d80b5ed7..5b52306e2e9553b9788ca0d4c950c6baef7a4ce0 100644 (file)
@@ -762,7 +762,7 @@ extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 
 /* ioctl.c */
 extern int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-extern int ext2_fileattr_set(struct user_namespace *mnt_userns,
+extern int ext2_fileattr_set(struct mnt_idmap *idmap,
                             struct dentry *dentry, struct fileattr *fa);
 extern long ext2_ioctl(struct file *, unsigned int, unsigned long);
 extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);
index e8340bf09b102cd6b9cb07ce1eab03f67b8398ba..dbd7de812cc1d23f5a04e6f603171472227da0b6 100644 (file)
@@ -27,7 +27,7 @@ int ext2_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int ext2_fileattr_set(struct user_namespace *mnt_userns,
+int ext2_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index b5e325434c5a55fabfe3404baba1dc64fadf5188..8d5008754cc255bb631022e6df5cfb755c3278ae 100644 (file)
@@ -3024,7 +3024,7 @@ extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode,
 /* ioctl.c */
 extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
 extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
-int ext4_fileattr_set(struct user_namespace *mnt_userns,
+int ext4_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa);
 int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa);
 extern void ext4_reset_inode_seed(struct inode *inode);
index 8067ccda34e457ed68728751337173ef90c4de49..f49496087102981c81ddba7c356af8f45f1465fd 100644 (file)
@@ -979,7 +979,7 @@ int ext4_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int ext4_fileattr_set(struct user_namespace *mnt_userns,
+int ext4_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index d6b13b03d75fb81f5e70e1806083c4070c2eca0d..cf0217d3640219bc315c9910ab50540d1165dee8 100644 (file)
@@ -3477,7 +3477,7 @@ int f2fs_truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end);
 void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count);
 int f2fs_precache_extents(struct inode *inode);
 int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int f2fs_fileattr_set(struct user_namespace *mnt_userns,
+int f2fs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa);
 long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
index a5e936a6225ad16f8c9718339b710e4ead0cdc40..96dd5cb2f49c1b0f3411c4fc0bd8f7b4dbd7ac65 100644 (file)
@@ -3092,7 +3092,7 @@ int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int f2fs_fileattr_set(struct user_namespace *mnt_userns,
+int f2fs_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 570941be0fd0ffa3a2ae6b79c42976832514fdca..ee084cead4020e11a138e728cd4b831bde291af5 100644 (file)
@@ -1309,7 +1309,7 @@ long fuse_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 long fuse_file_compat_ioctl(struct file *file, unsigned int cmd,
                            unsigned long arg);
 int fuse_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int fuse_fileattr_set(struct user_namespace *mnt_userns,
+int fuse_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa);
 
 /* file.c */
index fcce94ace2c23f9dcfd596e970002c203672a24b..e50a18ee6cc656a4a3d946336b2a4b7eb9183381 100644 (file)
@@ -467,7 +467,7 @@ cleanup:
        return err;
 }
 
-int fuse_fileattr_set(struct user_namespace *mnt_userns,
+int fuse_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index eea5be4fbf0eff056fb8e8600536abd6e94ca2b9..62d6316e8066e9668777cd0cb82ed3e7f6274a9d 100644 (file)
@@ -273,7 +273,7 @@ out:
        return error;
 }
 
-int gfs2_fileattr_set(struct user_namespace *mnt_userns,
+int gfs2_fileattr_set(struct mnt_idmap *idmap,
                      struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 0264d514dda787283e8139bee1edd03201d923ea..bd0c64b651585aecf4f831f918b2b3fc5c06e367 100644 (file)
@@ -111,7 +111,7 @@ extern const struct file_operations gfs2_file_fops_nolock;
 extern const struct file_operations gfs2_dir_fops_nolock;
 
 extern int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-extern int gfs2_fileattr_set(struct user_namespace *mnt_userns,
+extern int gfs2_fileattr_set(struct mnt_idmap *idmap,
                             struct dentry *dentry, struct fileattr *fa);
 extern void gfs2_set_inode_flags(struct inode *inode);
  
index d5f3ce0f8dada37ea30072056364be99825c17d5..7ededcb720c121794eb3782dd84ccff74685296b 100644 (file)
@@ -487,7 +487,7 @@ int hfsplus_getattr(struct mnt_idmap *idmap, const struct path *path,
 int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
                       int datasync);
 int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int hfsplus_fileattr_set(struct user_namespace *mnt_userns,
+int hfsplus_fileattr_set(struct mnt_idmap *idmap,
                         struct dentry *dentry, struct fileattr *fa);
 
 /* ioctl.c */
index ff98c1250d7ca4364df4c9ff767fcf5111671070..c9ce69728a53879b4018003a4b9fd44eb88890f3 100644 (file)
@@ -655,7 +655,7 @@ int hfsplus_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int hfsplus_fileattr_set(struct user_namespace *mnt_userns,
+int hfsplus_fileattr_set(struct mnt_idmap *idmap,
                         struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 80ac36aea913b8528d6698c8cb510424b35f3aee..2bf1bdaec2eeebcfa3d5d6ded0977c9cac7b071b 100644 (file)
@@ -651,7 +651,7 @@ static int fileattr_set_prepare(struct inode *inode,
 
 /**
  * vfs_fileattr_set - change miscellaneous file attributes
- * @mnt_userns:        user namespace of the mount
+ * @idmap:     idmap of the mount
  * @dentry:    the object to change
  * @fa:                fileattr pointer
  *
@@ -665,7 +665,7 @@ static int fileattr_set_prepare(struct inode *inode,
  *
  * Return: 0 on success, or a negative error on failure.
  */
-int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
+int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
                     struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
@@ -675,7 +675,7 @@ int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (!inode->i_op->fileattr_set)
                return -ENOIOCTLCMD;
 
-       if (!inode_owner_or_capable(mnt_userns, inode))
+       if (!inode_owner_or_capable(mnt_idmap_owner(idmap), inode))
                return -EPERM;
 
        inode_lock(inode);
@@ -693,7 +693,7 @@ int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
                }
                err = fileattr_set_prepare(inode, &old_ma, fa);
                if (!err)
-                       err = inode->i_op->fileattr_set(mnt_userns, dentry, fa);
+                       err = inode->i_op->fileattr_set(idmap, dentry, fa);
        }
        inode_unlock(inode);
 
@@ -714,7 +714,7 @@ static int ioctl_getflags(struct file *file, unsigned int __user *argp)
 
 static int ioctl_setflags(struct file *file, unsigned int __user *argp)
 {
-       struct user_namespace *mnt_userns = file_mnt_user_ns(file);
+       struct mnt_idmap *idmap = file_mnt_idmap(file);
        struct dentry *dentry = file->f_path.dentry;
        struct fileattr fa;
        unsigned int flags;
@@ -725,7 +725,7 @@ static int ioctl_setflags(struct file *file, unsigned int __user *argp)
                err = mnt_want_write_file(file);
                if (!err) {
                        fileattr_fill_flags(&fa, flags);
-                       err = vfs_fileattr_set(mnt_userns, dentry, &fa);
+                       err = vfs_fileattr_set(idmap, dentry, &fa);
                        mnt_drop_write_file(file);
                }
        }
@@ -746,7 +746,7 @@ static int ioctl_fsgetxattr(struct file *file, void __user *argp)
 
 static int ioctl_fssetxattr(struct file *file, void __user *argp)
 {
-       struct user_namespace *mnt_userns = file_mnt_user_ns(file);
+       struct mnt_idmap *idmap = file_mnt_idmap(file);
        struct dentry *dentry = file->f_path.dentry;
        struct fileattr fa;
        int err;
@@ -755,7 +755,7 @@ static int ioctl_fssetxattr(struct file *file, void __user *argp)
        if (!err) {
                err = mnt_want_write_file(file);
                if (!err) {
-                       err = vfs_fileattr_set(mnt_userns, dentry, &fa);
+                       err = vfs_fileattr_set(idmap, dentry, &fa);
                        mnt_drop_write_file(file);
                }
        }
index 1e7b177ece60579f5d66a461863fdd3f69baab5c..ed7989bc2db1dd91e7d9c04e8f2b7b4053c83443 100644 (file)
@@ -70,7 +70,7 @@ int jfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int jfs_fileattr_set(struct user_namespace *mnt_userns,
+int jfs_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 6440935a989515cfd4bb8555d579698dccb12b3b..ea80661597ac582d2de08bf7d8e70021c24a1d00 100644 (file)
@@ -10,7 +10,7 @@ struct fid;
 extern struct inode *ialloc(struct inode *, umode_t);
 extern int jfs_fsync(struct file *, loff_t, loff_t, int);
 extern int jfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-extern int jfs_fileattr_set(struct user_namespace *mnt_userns,
+extern int jfs_fileattr_set(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
 extern long jfs_ioctl(struct file *, unsigned int, unsigned long);
 extern struct inode *jfs_iget(struct super_block *, unsigned long);
index 87e1004b606d20d9726a8b58faabe5460eb4b1d7..91994b9955b557367b87e79bb4301fc1b2d28b2b 100644 (file)
@@ -128,7 +128,7 @@ int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
 /**
  * nilfs_fileattr_set - ioctl to support chattr
  */
-int nilfs_fileattr_set(struct user_namespace *mnt_userns,
+int nilfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 7bac8e515aceaf7c028d0b7c756befa571e658da..ff8ddc86ca0850dfe2d6433177ffe9673e388343 100644 (file)
@@ -242,7 +242,7 @@ extern int nilfs_sync_file(struct file *, loff_t, loff_t, int);
 
 /* ioctl.c */
 int nilfs_fileattr_get(struct dentry *dentry, struct fileattr *m);
-int nilfs_fileattr_set(struct user_namespace *mnt_userns,
+int nilfs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 long nilfs_ioctl(struct file *, unsigned int, unsigned long);
 long nilfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
index afd54ec661030d08587764ee48c49c0359bc22c4..811a6ea374bb6709b9e83a3d6edbc618190e151d 100644 (file)
@@ -82,7 +82,7 @@ int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return status;
 }
 
-int ocfs2_fileattr_set(struct user_namespace *mnt_userns,
+int ocfs2_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 0297c8846945ab34ffd0d8297dd9bafe5bec4cf0..48a5fdfe87a190eb4f10a162e3db04fdbfe74743 100644 (file)
@@ -12,7 +12,7 @@
 #define OCFS2_IOCTL_PROTO_H
 
 int ocfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ocfs2_fileattr_set(struct user_namespace *mnt_userns,
+int ocfs2_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg);
index 1e41eeee18e10855ff595e58a785a1ebdac60d33..328e49857242a4d32dd3caef70637e1afe0fc9f9 100644 (file)
@@ -944,7 +944,7 @@ static int orangefs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-static int orangefs_fileattr_set(struct user_namespace *mnt_userns,
+static int orangefs_fileattr_set(struct mnt_idmap *idmap,
                                 struct dentry *dentry, struct fileattr *fa)
 {
        u64 val = 0;
index f52d9304d7e42dbb7123448c67f67a8185f2219f..a41a03fcf6bc67797823bcb8ecf3c5faee1a92a3 100644 (file)
@@ -757,10 +757,10 @@ int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa)
        if (err)
                return err;
 
-       return vfs_fileattr_set(mnt_user_ns(realpath->mnt), realpath->dentry, fa);
+       return vfs_fileattr_set(mnt_idmap(realpath->mnt), realpath->dentry, fa);
 }
 
-int ovl_fileattr_set(struct user_namespace *mnt_userns,
+int ovl_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 0f2ac8402f10b3168f3754ad6c09d853d9f34638..8091b1914ea3bfa60c96969570d38afa9a383ea0 100644 (file)
@@ -718,7 +718,7 @@ void ovl_aio_request_cache_destroy(void);
 int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa);
 int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa);
 int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ovl_fileattr_set(struct user_namespace *mnt_userns,
+int ovl_fileattr_set(struct mnt_idmap *idmap,
                     struct dentry *dentry, struct fileattr *fa);
 
 /* copy_up.c */
index 4b86ecf5817e3a227cee7cf82529211587df75db..12800dfc11a9f11574c0f130d6dc17909e879d0d 100644 (file)
@@ -24,7 +24,7 @@ int reiserfs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int reiserfs_fileattr_set(struct user_namespace *mnt_userns,
+int reiserfs_fileattr_set(struct mnt_idmap *idmap,
                          struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 9a4a7f7897fefbcb1dd10e27cf5f63db25e6025b..98e6f53c2fe0d00a78b3595ed3845b454c1f7508 100644 (file)
@@ -3407,7 +3407,7 @@ __u32 r5_hash(const signed char *msg, int len);
 
 /* prototypes from ioctl.c */
 int reiserfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int reiserfs_fileattr_set(struct user_namespace *mnt_userns,
+int reiserfs_fileattr_set(struct mnt_idmap *idmap,
                          struct dentry *dentry, struct fileattr *fa);
 long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 long reiserfs_compat_ioctl(struct file *filp,
index 71bcebe45f9c588a8cd30805d8ee091a85b6e536..67c5108abd894f7ba053624766e937e63dedef04 100644 (file)
@@ -144,7 +144,7 @@ int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-int ubifs_fileattr_set(struct user_namespace *mnt_userns,
+int ubifs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);
index 1d2fdef6dfa06c2a6d570c2ee624ae02dfc8db75..9063b73536f805cffecd8e5e25bdd8fa48d29fb8 100644 (file)
@@ -2085,7 +2085,7 @@ void ubifs_destroy_size_tree(struct ubifs_info *c);
 
 /* ioctl.c */
 int ubifs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int ubifs_fileattr_set(struct user_namespace *mnt_userns,
+int ubifs_fileattr_set(struct mnt_idmap *idmap,
                       struct dentry *dentry, struct fileattr *fa);
 long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 void ubifs_set_inode_flags(struct inode *inode);
index 13f1b2add39041e0a6050e07440fdca207026d58..27c7876ff526a2266577554b64081104e22274ef 100644 (file)
@@ -1297,10 +1297,11 @@ xfs_ioctl_setattr_check_projid(
 
 int
 xfs_fileattr_set(
-       struct user_namespace   *mnt_userns,
+       struct mnt_idmap        *idmap,
        struct dentry           *dentry,
        struct fileattr         *fa)
 {
+       struct user_namespace *mnt_userns = mnt_idmap_owner(idmap);
        struct xfs_inode        *ip = XFS_I(d_inode(dentry));
        struct xfs_mount        *mp = ip->i_mount;
        struct xfs_trans        *tp;
index d4abba2c13c1ae166c2052806287a90fda9b7599..38be600b5e1e8391c52f0fdf0db69ff6f498125a 100644 (file)
@@ -49,7 +49,7 @@ xfs_fileattr_get(
 
 extern int
 xfs_fileattr_set(
-       struct user_namespace   *mnt_userns,
+       struct mnt_idmap        *idmap,
        struct dentry           *dentry,
        struct fileattr         *fa);
 
index 9e37e063ac6984e7ed58d0a8b8abd06cbfda4834..47c05a9851d0600964b644c9c7218faacfd865f8 100644 (file)
@@ -53,7 +53,7 @@ static inline bool fileattr_has_fsx(const struct fileattr *fa)
 }
 
 int vfs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
-int vfs_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry,
+int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
                     struct fileattr *fa);
 
 #endif /* _LINUX_FILEATTR_H */
index 85d8e4bc779879997a3fefc97b30a59c25d271a6..349f71650fa21a6cb868647bfb05a4840dba2434 100644 (file)
@@ -2168,7 +2168,7 @@ struct inode_operations {
                                     int);
        int (*set_acl)(struct mnt_idmap *, struct dentry *,
                       struct posix_acl *, int);
-       int (*fileattr_set)(struct user_namespace *mnt_userns,
+       int (*fileattr_set)(struct mnt_idmap *idmap,
                            struct dentry *dentry, struct fileattr *fa);
        int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
 } ____cacheline_aligned;
index ad768241147c54aa49cab25697c132331365fbe4..d2f27ddd481e44d696f89c4e2a89eff830294cb7 100644 (file)
@@ -3229,7 +3229,7 @@ static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa)
        return 0;
 }
 
-static int shmem_fileattr_set(struct user_namespace *mnt_userns,
+static int shmem_fileattr_set(struct mnt_idmap *idmap,
                              struct dentry *dentry, struct fileattr *fa)
 {
        struct inode *inode = d_inode(dentry);