diff mbox series

[1/6] memcontrol02: Remove O_TMPFILE TCONF check

Message ID 20220127061225.23368-2-rpalethorpe@suse.com
State Accepted
Headers show
Series Add memcontrol03 and declarative CG API | expand

Commit Message

Richard Palethorpe Jan. 27, 2022, 6:12 a.m. UTC
We don't use O_TMPFILE anymore because the whole FS is temporary.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 testcases/kernel/controllers/memcg/memcontrol02.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Cyril Hrubis Jan. 28, 2022, 9:55 a.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff mbox series

Patch

diff --git a/testcases/kernel/controllers/memcg/memcontrol02.c b/testcases/kernel/controllers/memcg/memcontrol02.c
index 9fa4ff811..548f36829 100644
--- a/testcases/kernel/controllers/memcg/memcontrol02.c
+++ b/testcases/kernel/controllers/memcg/memcontrol02.c
@@ -94,16 +94,7 @@  static void alloc_pagecache_50M_check(void)
 	const char *const file_key_fmt =
 		TST_CGROUP_VER_IS_V1(cg_test, "memory") ? "cache %zd" : "file %zd";
 
-	TEST(open(TMPDIR"/tmpfile", O_RDWR | O_CREAT, 0600));
-
-	if (TST_RET < 0) {
-		if (TST_ERR == EOPNOTSUPP)
-			tst_brk(TCONF, "O_TMPFILE not supported by FS");
-
-		tst_brk(TBROK | TTERRNO,
-			"open(%s, O_TMPFILE | O_RDWR | O_EXCL", TMPDIR"/.");
-	}
-	fd = TST_RET;
+	fd = SAFE_OPEN(TMPDIR"/tmpfile", O_RDWR | O_CREAT, 0600);
 
 	SAFE_CGROUP_SCANF(cg_child, "memory.current", "%zu", &current);
 	tst_res(TINFO, "Created temp file: memory.current=%zu", current);