All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/fadvise03: add alternative expected s390-only values
@ 2015-02-26 19:17 Jiri Jaburek
  2015-03-02 11:47 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Jaburek @ 2015-02-26 19:17 UTC (permalink / raw)
  To: ltp-list

Since this test tries 0-32 values as 'advice', it needs to expect the
little-known ABI hack used for fadvise64 on s390 in the kernel,
see Linux kernel commit 068e1b94bbd268f375349f68531829c8b7c210bc.

Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
---
 testcases/kernel/syscalls/fadvise/posix_fadvise03.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
index db88765..1e77740 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
@@ -65,9 +65,25 @@ int defined_advise[] = {
 	POSIX_FADV_NORMAL,
 	POSIX_FADV_SEQUENTIAL,
 	POSIX_FADV_RANDOM,
-	POSIX_FADV_NOREUSE,
 	POSIX_FADV_WILLNEED,
+#if defined(__s390__) && __WORDSIZE == 32
+	/* POSIX_FADV_DONTNEED and POSIX_FADV_NOREUSE are 6,7 on 31bit s390,
+	 * but the kernel accepts 4,5 as well and rewrites them internally,
+	 * see Linux kernel commit 068e1b94bbd268f375349f68531829c8b7c210bc
+	 *
+	 * since header definitions are incomplete - posix fcntl.h doesn't care
+	 * and defines them as 4,5 while linux/fadvise.h (which uses 6,7)
+	 * matches only 64bit - we need to hardcode the values here for
+	 * all 4 cases, unfortunately
+	 */
+	4, /* POSIX_FADV_DONTNEED */
+	5, /* POSIX_FADV_NOREUSE */
+	6, /* POSIX_FADV_DONTNEED */
+	7, /* POSIX_FADV_NOREUSE */
+#else
 	POSIX_FADV_DONTNEED,
+	POSIX_FADV_NOREUSE,
+#endif
 };
 
 #define defined_advise_total (sizeof(defined_advise) / sizeof(defined_advise[0]))
-- 
2.1.0


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] syscalls/fadvise03: add alternative expected s390-only values
  2015-02-26 19:17 [LTP] [PATCH] syscalls/fadvise03: add alternative expected s390-only values Jiri Jaburek
@ 2015-03-02 11:47 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2015-03-02 11:47 UTC (permalink / raw)
  To: Jiri Jaburek; +Cc: ltp-list

Hi!
> Since this test tries 0-32 values as 'advice', it needs to expect the
> little-known ABI hack used for fadvise64 on s390 in the kernel,
> see Linux kernel commit 068e1b94bbd268f375349f68531829c8b7c210bc.
> 
> Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2015-03-02 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 19:17 [LTP] [PATCH] syscalls/fadvise03: add alternative expected s390-only values Jiri Jaburek
2015-03-02 11:47 ` Cyril Hrubis

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.