ovl: support idmapped layers
Now that overlay is able to take a layers idmapping into account allow
overlay mounts to be created on top of idmapped mounts.
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>
---
/* v2 */
- Turn on support for idmapped mounts in ovl_upper_idmap() helper here
after we've introduced it earlier in the series and made it return the
initial idmapping.
/* v3 */
unchanged
/* v4 */
unchanged
/* v5 */
unchanged
diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h
index 8630fd9..e1af8f6 100644
--- a/fs/overlayfs/ovl_entry.h
+++ b/fs/overlayfs/ovl_entry.h
@@ -92,7 +92,7 @@
static inline struct user_namespace *ovl_upper_mnt_userns(struct ovl_fs *ofs)
{
- return &init_user_ns;
+ return mnt_user_ns(ovl_upper_mnt(ofs));
}
static inline struct ovl_fs *OVL_FS(struct super_block *sb)
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 0123c80..e0a2e04 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -874,10 +874,6 @@
pr_err("filesystem on '%s' not supported\n", name);
goto out_put;
}
- if (is_idmapped_mnt(path->mnt)) {
- pr_err("idmapped layers are currently not supported\n");
- goto out_put;
- }
if (!d_is_dir(path->dentry)) {
pr_err("'%s' not a directory\n", name);
goto out_put;