]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: allow idmapped create inode op
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 27 Jul 2021 10:48:45 +0000 (12:48 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:13 +0000 (13:19 +0200)
Enable btrfs_create() to handle idmapped mounts. This is just a matter
of passing down the mount's userns.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 4a1cc106ab1f8ec674e1fb2f24322c6d2556d46a..a75661cd68ecc97c275db1291941b733ffaaa61f 100644 (file)
@@ -6781,7 +6781,7 @@ static int btrfs_create(struct user_namespace *mnt_userns, struct inode *dir,
        if (err)
                goto out_unlock;
 
-       inode = btrfs_new_inode(trans, root, &init_user_ns, dir,
+       inode = btrfs_new_inode(trans, root, mnt_userns, dir,
                        dentry->d_name.name, dentry->d_name.len,
                        btrfs_ino(BTRFS_I(dir)), objectid, mode, &index);
        if (IS_ERR(inode)) {