All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported
@ 2023-11-02 23:00 Edward Liaw via ltp
  2023-11-02 23:00 ` [LTP] [PATCH] madvise11: Replace /etc/mtab with /proc/mounts Edward Liaw via ltp
  2023-11-03 10:47 ` [LTP] [PATCH] madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported Cyril Hrubis
  0 siblings, 2 replies; 6+ messages in thread
From: Edward Liaw via ltp @ 2023-11-02 23:00 UTC (permalink / raw)
  To: ltp; +Cc: kernel-team

madvise11 will exit with TFAIL if CONFIG_MEMORY_FAILURE is not
configured.  Skip the TFAIL if EINVAL is returned by madvise.

Signed-off-by: Edward Liaw <edliaw@google.com>
---
 testcases/kernel/syscalls/madvise/madvise11.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/madvise/madvise11.c b/testcases/kernel/syscalls/madvise/madvise11.c
index 3cde85ef5..0793319d2 100644
--- a/testcases/kernel/syscalls/madvise/madvise11.c
+++ b/testcases/kernel/syscalls/madvise/madvise11.c
@@ -162,7 +162,7 @@ static void *alloc_mem(void *threadnum)
 	err = allocate_offline(tnum);
 	tst_res(TINFO,
 		"Thread [%d] returned %d, %s.", tnum, err, (err ? "failed" : "succeeded"));
-	return (void *)(uintptr_t) (err ? -1 : 0);
+	return (void *)(uintptr_t) err;
 }
 
 static void stress_alloc_offl(void)
@@ -188,8 +188,9 @@ static void stress_alloc_offl(void)
 
 		SAFE_PTHREAD_JOIN(thread_ids[thread_index], &status);
 		if ((intptr_t)status != 0) {
-			tst_res(TFAIL, "thread [%d] - exited with errors",
-				thread_index);
+			if ((intptr_t)status != EINVAL)
+				tst_res(TFAIL, "thread [%d] - exited with errors",
+					thread_index);
 			thread_failure++;
 		}
 	}
-- 
2.42.0.869.gea05f2083d-goog


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

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

end of thread, other threads:[~2023-11-03 15:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 23:00 [LTP] [PATCH] madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported Edward Liaw via ltp
2023-11-02 23:00 ` [LTP] [PATCH] madvise11: Replace /etc/mtab with /proc/mounts Edward Liaw via ltp
2023-11-03  8:29   ` Petr Vorel
2023-11-03  8:38     ` Petr Vorel
2023-11-03 10:47 ` [LTP] [PATCH] madvise11: Allow test to skip if MADV_SOFT_OFFLINE is not supported Cyril Hrubis
2023-11-03 15:54   ` Edward Liaw via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.