summaryrefslogtreecommitdiff
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2022-04-04 13:51:51 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2022-04-28 17:31:11 +0300
commit50db8d0273551f8792b4d9367d43a0093fb4512d (patch)
tree4b5f3d2dd8f9e6c0173fb289cbe40ba3036f2738 /fs/overlayfs
parentdad7017a840d8d198074338224cd418d37b8f79d (diff)
downloadlinux-50db8d0273551f8792b4d9367d43a0093fb4512d.tar.xz
ovl: handle idmappings for layer fileattrs
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>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index c7f2a2a8ac1d..7ed5df9c0fa6 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -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,