提交 d4d09464 编写于 作者: C Christian Brauner 提交者: David Sterba

btrfs: allow idmapped setattr inode op

Enable btrfs_setattr() to handle idmapped mounts. This is just a matter
of passing down the mount's userns.
Reviewed-by: NJosef Bacik <josef@toxicpanda.com>
Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 98b6ab5f
...@@ -5392,7 +5392,7 @@ static int btrfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentr ...@@ -5392,7 +5392,7 @@ static int btrfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentr
if (btrfs_root_readonly(root)) if (btrfs_root_readonly(root))
return -EROFS; return -EROFS;
err = setattr_prepare(&init_user_ns, dentry, attr); err = setattr_prepare(mnt_userns, dentry, attr);
if (err) if (err)
return err; return err;
...@@ -5403,13 +5403,12 @@ static int btrfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentr ...@@ -5403,13 +5403,12 @@ static int btrfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentr
} }
if (attr->ia_valid) { if (attr->ia_valid) {
setattr_copy(&init_user_ns, inode, attr); setattr_copy(mnt_userns, inode, attr);
inode_inc_iversion(inode); inode_inc_iversion(inode);
err = btrfs_dirty_inode(inode); err = btrfs_dirty_inode(inode);
if (!err && attr->ia_valid & ATTR_MODE) if (!err && attr->ia_valid & ATTR_MODE)
err = posix_acl_chmod(&init_user_ns, inode, err = posix_acl_chmod(mnt_userns, inode, inode->i_mode);
inode->i_mode);
} }
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册