Skip to content

Commit

Permalink
ovl: handle idmappings for layer fileattrs
Browse files Browse the repository at this point in the history
Take the upper mount's idmapping into account when setting fileattrs on
the upper layer. This is needed to support idmapped base layers with
overlay.

Cc: <linux-unionfs@vger.kernel.org>
Tested-by: Giuseppe Scrivano <gscrivan@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
  • Loading branch information
Christian Brauner authored and Miklos Szeredi committed Apr 28, 2022
1 parent dad7017 commit 50db8d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/inode.c
Original file line number Diff line number Diff line change
@@ -537,7 +537,7 @@ int ovl_real_fileattr_set(struct path *realpath, struct fileattr *fa)
if (err)
return err;

return vfs_fileattr_set(&init_user_ns, realpath->dentry, fa);
return vfs_fileattr_set(mnt_user_ns(realpath->mnt), realpath->dentry, fa);
}

int ovl_fileattr_set(struct user_namespace *mnt_userns,

0 comments on commit 50db8d0

Please sign in to comment.