summaryrefslogtreecommitdiffstats
path: root/fs/erofs/super.c
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-05-17 18:41:03 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2022-05-17 23:56:20 +0800
commit6c459b78d4793afbba6d864c466cc5cd2932459d (patch)
tree198e4f7b5ac58d04e18306d38621e2c793b394ca /fs/erofs/super.c
parent3e917cc305c6df350af5ad5c40d56e3e48b42281 (diff)
downloadlinux-stable-6c459b78d4793afbba6d864c466cc5cd2932459d.tar.gz
linux-stable-6c459b78d4793afbba6d864c466cc5cd2932459d.tar.bz2
linux-stable-6c459b78d4793afbba6d864c466cc5cd2932459d.zip
erofs: support idmapped mounts
This patch enables idmapped mounts for erofs, since all dedicated helpers for this functionality existsm, so, in this patch we just pass down the user_namespace argument from the VFS methods to the relevant helpers. Simple idmap example on erofs image: 1. mkdir dir 2. touch dir/file 3. mkfs.erofs erofs.img dir 4. mount -t erofs -o loop erofs.img /mnt/erofs/ 5. ls -ln /mnt/erofs/ total 0 -rw-rw-r-- 1 1000 1000 0 May 17 15:26 file 6. mount-idmapped --map-mount b:1000:1001:1 /mnt/erofs/ /mnt/scratch_erofs/ 7. ls -ln /mnt/scratch_erofs/ total 0 -rw-rw-r-- 1 1001 1001 0 May 17 15:26 file Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Chao Yu <chao.yu@oppo.com> Link: https://lore.kernel.org/r/20220517104103.3570721-1-chao@kernel.org Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/super.c')
-rw-r--r--fs/erofs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index dbfe2cbbb00e..a326445af7d0 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -821,7 +821,7 @@ static struct file_system_type erofs_fs_type = {
.name = "erofs",
.init_fs_context = erofs_init_fs_context,
.kill_sb = erofs_kill_sb,
- .fs_flags = FS_REQUIRES_DEV,
+ .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
};
MODULE_ALIAS_FS("erofs");