mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] overlayfs: add FS_ALLOW_IDMAP flag to enable idmapped mounts
@ 2025-08-15 15:06 Sohan Kunkerkar
  2025-08-15 15:30 ` Amir Goldstein
  0 siblings, 1 reply; 3+ messages in thread
From: Sohan Kunkerkar @ 2025-08-15 15:06 UTC (permalink / raw)
  To: miklos, amir73il; +Cc: linux-unionfs, linux-kernel, Sohan Kunkerkar

OverlayFS already has comprehensive support for idmapped mounts through
its ovl_copyattr() function and proper mnt_idmap() handling throughout
the codebase. The infrastructure correctly maps UIDs/GIDs from idmapped
upper and lower layers.

However, the filesystem was missing the FS_ALLOW_IDMAP flag, which
caused mount_setattr() calls with MOUNT_ATTR_IDMAP to fail with -EINVAL.

This change enables idmapped mount support by adding the FS_ALLOW_IDMAP
flag to the overlayfs file_system_type, allowing containers and other
applications to use idmapped mounts with overlay filesystems.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
---
 fs/overlayfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index e19940d64..c628f9179 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1516,7 +1516,7 @@ struct file_system_type ovl_fs_type = {
 	.name			= "overlay",
 	.init_fs_context	= ovl_init_fs_context,
 	.parameters		= ovl_parameter_spec,
-	.fs_flags		= FS_USERNS_MOUNT,
+	.fs_flags		= FS_USERNS_MOUNT | FS_ALLOW_IDMAP,
 	.kill_sb		= kill_anon_super,
 };
 MODULE_ALIAS_FS("overlay");
-- 
2.50.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-19 11:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-15 15:06 [PATCH] overlayfs: add FS_ALLOW_IDMAP flag to enable idmapped mounts Sohan Kunkerkar
2025-08-15 15:30 ` Amir Goldstein
2025-08-19 11:18   ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®