diff mbox series

[05/11] vfs: Specify wether a test is run inside a userns or not

Message ID 20230307114507.332309-6-rodrigo@sdfg.com.ar (mailing list archive)
State New, archived
Headers show
Series Tests for idmapped tmpfs | expand

Commit Message

Rodrigo Campos March 7, 2023, 11:45 a.m. UTC
This bool that is initialized to false will be used in future pathces,
when we will reuse some existing tests to run them inside a userns and
with some fs-specific setup.

Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar>
---
 src/vfs/utils.h   | 2 ++
 src/vfs/vfstest.c | 1 +
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git src/vfs/utils.h src/vfs/utils.h
index f1681737..4c796559 100644
--- src/vfs/utils.h
+++ src/vfs/utils.h
@@ -197,6 +197,8 @@  struct vfstest_info {
 	bool t_fs_allow_idmap;
 	/* whether user namespaces are supported */
 	bool t_has_userns;
+	/* whether this test is running inside a userns */
+	bool t_inside_userns;
 };
 
 struct test_struct {
diff --git src/vfs/vfstest.c src/vfs/vfstest.c
index 20ade869..3ec65dff 100644
--- src/vfs/vfstest.c
+++ src/vfs/vfstest.c
@@ -42,6 +42,7 @@  static void init_vfstest_info(struct vfstest_info *info)
 	info->t_mnt_scratch_fd		= -EBADF;
 	info->t_dir1_fd			= -EBADF;
 	info->t_fs_allow_idmap		= false;
+	info->t_inside_userns		= false;
 }
 
 static void stash_overflowuid(struct vfstest_info *info)