aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <[email protected]>2022-04-04 12:51:51 +0200
committerMiklos Szeredi <[email protected]>2022-04-28 16:31:11 +0200
commit50db8d0273551f8792b4d9367d43a0093fb4512d (patch)
tree4b5f3d2dd8f9e6c0173fb289cbe40ba3036f2738
parentdad7017a840d8d198074338224cd418d37b8f79d (diff)
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: <[email protected]> Tested-by: Giuseppe Scrivano <[email protected]> Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Christian Brauner (Microsoft) <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
-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,