public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] syscalls/{fanotify17, getxattr05}: Fix the ENOSPC error
@ 2024-09-25  8:49 Xiao Yang
  2024-09-26 11:18 ` Cyril Hrubis
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Xiao Yang @ 2024-09-25  8:49 UTC (permalink / raw)
  To: ltp

If the value of max_user_namespaces is set to 10 but more than
10 user namspaces are currently used on system.  In this case,
these tests fail with ENOSPC. for example:

# lsns -t user -n | wc -l
17

# ./fanotify17
...
fanotify17.c:174: TINFO: Test #0: Global groups limit in init user ns
fanotify17.c:130: TPASS: Created 128 groups - below groups limit (128)
fanotify17.c:174: TINFO: Test #1: Global groups limit in privileged user ns
fanotify17.c:154: TFAIL: unshare(CLONE_NEWUSER) failed: ENOSPC (28)
tst_test.c:452: TBROK: Invalid child (6958) exit value 1

Try to fix the issue by increasing the default value of
max_user_namespaces by 10.

Signed-off-by: Xiao Yang <ice_yangxiao@163.com>
---
 testcases/kernel/syscalls/fanotify/fanotify17.c | 2 +-
 testcases/kernel/syscalls/getxattr/getxattr05.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/fanotify/fanotify17.c b/testcases/kernel/syscalls/fanotify/fanotify17.c
index 3ecb31b6e..a6206d953 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify17.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify17.c
@@ -224,7 +224,7 @@ static void setup(void)
 		user_ns_supported = 0;
 	} else if (!access(MAX_USERNS, F_OK)) {
 		SAFE_FILE_SCANF(MAX_USERNS, "%d", &orig_max_userns);
-		SAFE_FILE_PRINTF(MAX_USERNS, "%d", 10);
+		SAFE_FILE_PRINTF(MAX_USERNS, "%d", orig_max_userns + 10);
 	}
 
 	/*
diff --git a/testcases/kernel/syscalls/getxattr/getxattr05.c b/testcases/kernel/syscalls/getxattr/getxattr05.c
index d9717a695..f1c8e8391 100644
--- a/testcases/kernel/syscalls/getxattr/getxattr05.c
+++ b/testcases/kernel/syscalls/getxattr/getxattr05.c
@@ -156,7 +156,7 @@ static void setup(void)
 		user_ns_supported = 0;
 	} else if (!access(MAX_USERNS, F_OK)) {
 		SAFE_FILE_SCANF(MAX_USERNS, "%d", &orig_max_userns);
-		SAFE_FILE_PRINTF(MAX_USERNS, "%d", 10);
+		SAFE_FILE_PRINTF(MAX_USERNS, "%d", orig_max_userns + 10);
 	}
 
 }
-- 
2.46.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2025-04-29  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25  8:49 [LTP] [PATCH v2] syscalls/{fanotify17, getxattr05}: Fix the ENOSPC error Xiao Yang
2024-09-26 11:18 ` Cyril Hrubis
2024-11-04 16:38   ` Petr Vorel
2024-11-04 16:45 ` Petr Vorel
2025-01-27 17:14 ` Petr Vorel
2025-04-29  9:47 ` Cyril Hrubis

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