Skip to contentSkip to conversation

madvise: remove the min_kver check

PATCH New Li Wang 2 participants 2 messages Jul 23, 2018

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 madvise: remove the min_kver check

For the reason that most of LTS enterprise linux distribution backport this MADV_WIPEONFORK feature, here let's cancel the kernel limitation to make madvise(..., MADV_WIPEONFORK) test more widely.

---
 testcases/kernel/syscalls/madvise/madvise10.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
testcases/kernel/syscalls/madvise/madvise10.c +6 -2
index f040c2d..9cb3d2b 100644
@@ -103,8 +103,13 @@ static int set_advice(char *addr, int size, int advise)
 	TEST(madvise(addr, size, advise));
 
 	if (TEST_RETURN == -1) {
-		tst_res(TFAIL | TTERRNO, "madvise(%p, %d, 0x%x)",
+		if (TEST_ERRNO == EINVAL) {
+			tst_res(TCONF, "madvise(%p, %d, 0x%x) is not supported",
 			addr, size, advise);
+		} else {
+			tst_res(TFAIL | TTERRNO, "madvise(%p, %d, 0x%x)",
+			addr, size, advise);
+		}
 
 		return 1;
 	}
@@ -175,5 +180,4 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.test = test_madvise,
 	.setup = setup,
-	.min_kver = "4.14",
 };
Signature · 1 line
2.9.5
#1 lore raw

PATCH 1/1 madvise: remove the min_kver check

----- Original Message -----

Quoted 5 lines

For the reason that most of LTS enterprise linux distribution backport this MADV_WIPEONFORK feature, here let's cancel the kernel limitation to make madvise(..., MADV_WIPEONFORK) test more widely.

We can do that, EINVAL should be quite clear here. I opened
https://github.com/linux-test-project/ltp/issues/371 to add the other scenarios that could lead to EINVAL.

Patch pushed.

Regards,
Jan