* [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
@ 2022-05-19 17:41 Andrea Cervesato
2022-05-20 7:30 ` Petr Vorel
2022-05-20 9:19 ` Cyril Hrubis
0 siblings, 2 replies; 9+ messages in thread
From: Andrea Cervesato @ 2022-05-19 17:41 UTC (permalink / raw)
To: ltp
run_child flag is commonly used by aiodio tests in order to check if
tests are passed or not and compiler seems to optimize run_child flag
because it's not defined as volatile. With this patch we ensure that the
flag is set as volatile so tests will work as expected on s390.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
---
testcases/kernel/io/ltp-aiodio/aiodio_append.c | 4 ++--
testcases/kernel/io/ltp-aiodio/aiodio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_append.c | 7 +++++--
testcases/kernel/io/ltp-aiodio/dio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_truncate.c | 4 ++--
5 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_append.c b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
index 46cc74ee4..e42c577cd 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
@@ -24,7 +24,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -133,7 +133,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
index 2aa5662bb..9aa9b8d54 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
@@ -28,7 +28,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -181,7 +181,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_append.c b/testcases/kernel/io/ltp-aiodio/dio_append.c
index c099793f6..3a7e7c836 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
@@ -19,7 +19,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -49,7 +49,10 @@ static void setup(void)
static void cleanup(void)
{
- SAFE_MUNMAP(run_child, sizeof(int));
+ if (run_child) {
+ *run_child = 0;
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
+ }
}
static void run(void)
diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
index 0039daa8d..661afde4c 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
@@ -26,7 +26,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -85,7 +85,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
index 1fbf83de0..0fe6b87ac 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
@@ -33,7 +33,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_filesize;
@@ -109,7 +109,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
--
2.36.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-19 17:41 [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390 Andrea Cervesato
@ 2022-05-20 7:30 ` Petr Vorel
2022-05-20 8:10 ` Andrea Cervesato via ltp
2022-05-20 9:19 ` Cyril Hrubis
1 sibling, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2022-05-20 7:30 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi Andrea,
> --- a/testcases/kernel/io/ltp-aiodio/dio_append.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
> @@ -19,7 +19,7 @@
> #include "tst_test.h"
> #include "common.h"
> -static int *run_child;
> +static volatile int *run_child;
> static char *str_numchildren;
> static char *str_writesize;
> @@ -49,7 +49,10 @@ static void setup(void)
> static void cleanup(void)
> {
> - SAFE_MUNMAP(run_child, sizeof(int));
> + if (run_child) {
> + *run_child = 0;
> + SAFE_MUNMAP((void *)run_child, sizeof(int));
> + }
nit: This looks like unrelated, right? If yes it could be in separate commit.
But I'm ok to merge it in single commit.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-20 7:30 ` Petr Vorel
@ 2022-05-20 8:10 ` Andrea Cervesato via ltp
0 siblings, 0 replies; 9+ messages in thread
From: Andrea Cervesato via ltp @ 2022-05-20 8:10 UTC (permalink / raw)
To: Petr Vorel, Andrea Cervesato; +Cc: ltp
[-- Attachment #1.1: Type: text/plain, Size: 1080 bytes --]
Hi Petr,
that was missing from the previous implementation indeed. Something that was checked in the other tests, but not this one. Probably because it's also the older test we refactor in the aiodio testing suite. It seems related to the bug and the volatile variable, so I added it as well.
Andrea
On 5/20/22 09:30, Petr Vorel wrote:
> Hi Andrea,
>
>> --- a/testcases/kernel/io/ltp-aiodio/dio_append.c
>> +++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
>> @@ -19,7 +19,7 @@
>> #include "tst_test.h"
>> #include "common.h"
>> -static int *run_child;
>> +static volatile int *run_child;
>> static char *str_numchildren;
>> static char *str_writesize;
>> @@ -49,7 +49,10 @@ static void setup(void)
>> static void cleanup(void)
>> {
>> - SAFE_MUNMAP(run_child, sizeof(int));
>> + if (run_child) {
>> + *run_child = 0;
>> + SAFE_MUNMAP((void *)run_child, sizeof(int));
>> + }
> nit: This looks like unrelated, right? If yes it could be in separate commit.
> But I'm ok to merge it in single commit.
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> Kind regards,
> Petr
>
[-- Attachment #1.2: Type: text/html, Size: 2148 bytes --]
[-- Attachment #2: Type: text/plain, Size: 60 bytes --]
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-19 17:41 [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390 Andrea Cervesato
2022-05-20 7:30 ` Petr Vorel
@ 2022-05-20 9:19 ` Cyril Hrubis
2022-05-20 12:01 ` Petr Vorel
1 sibling, 1 reply; 9+ messages in thread
From: Cyril Hrubis @ 2022-05-20 9:19 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi!
> run_child flag is commonly used by aiodio tests in order to check if
> tests are passed or not and compiler seems to optimize run_child flag
^
test has finished?
> because it's not defined as volatile. With this patch we ensure that the
> flag is set as volatile so tests will work as expected on s390.
>
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
The change itself looks fine and should go in before the release.
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-20 9:19 ` Cyril Hrubis
@ 2022-05-20 12:01 ` Petr Vorel
0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2022-05-20 12:01 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi all,
> Hi!
> > run_child flag is commonly used by aiodio tests in order to check if
> > tests are passed or not and compiler seems to optimize run_child flag
> ^
> test has finished?
> > because it's not defined as volatile. With this patch we ensure that the
> > flag is set as volatile so tests will work as expected on s390.
> > Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
> The change itself looks fine and should go in before the release.
Merged with amended commit message. Thanks Andrea!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-19 13:12 Andrea Cervesato via ltp
@ 2022-05-19 14:00 ` Cyril Hrubis
0 siblings, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2022-05-19 14:00 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: LTP List
Hi!
Still broken, looks like the whitespaces have been replaced with UTF8
non-breakable spaces (C2A0).
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
@ 2022-05-19 13:12 Andrea Cervesato via ltp
2022-05-19 14:00 ` Cyril Hrubis
0 siblings, 1 reply; 9+ messages in thread
From: Andrea Cervesato via ltp @ 2022-05-19 13:12 UTC (permalink / raw)
To: LTP List
run_child flag is commonly used by aiodio tests in order to check if
tests are passed or not and compiler seems to optimize run_child flag
because it's not defined as volatile. With this patch we ensure that the
flag is set as volatile so tests will work as expected on s390.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
---
testcases/kernel/io/ltp-aiodio/aiodio_append.c | 4 ++--
testcases/kernel/io/ltp-aiodio/aiodio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_append.c | 7 +++++--
testcases/kernel/io/ltp-aiodio/dio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_truncate.c | 4 ++--
5 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_append.c b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
index 46cc74ee4..e42c577cd 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
@@ -24,7 +24,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -133,7 +133,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
index 2aa5662bb..9aa9b8d54 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
@@ -28,7 +28,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -181,7 +181,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_append.c b/testcases/kernel/io/ltp-aiodio/dio_append.c
index c099793f6..3a7e7c836 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
@@ -19,7 +19,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -49,7 +49,10 @@ static void setup(void)
static void cleanup(void)
{
- SAFE_MUNMAP(run_child, sizeof(int));
+ if (run_child) {
+ *run_child = 0;
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
+ }
}
static void run(void)
diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
index 0039daa8d..661afde4c 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
@@ -26,7 +26,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -85,7 +85,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
index 1fbf83de0..0fe6b87ac 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
@@ -33,7 +33,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_filesize;
@@ -109,7 +109,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
--
2.36.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
2022-05-19 12:19 Andrea Cervesato via ltp
@ 2022-05-19 12:54 ` Cyril Hrubis
0 siblings, 0 replies; 9+ messages in thread
From: Cyril Hrubis @ 2022-05-19 12:54 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi!
Looks like the patch got corrupted by your email client, can you please
turn off any smart formatting and resend?
See also:
https://www.kernel.org/doc/html/v4.10/process/email-clients.html
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390
@ 2022-05-19 12:19 Andrea Cervesato via ltp
2022-05-19 12:54 ` Cyril Hrubis
0 siblings, 1 reply; 9+ messages in thread
From: Andrea Cervesato via ltp @ 2022-05-19 12:19 UTC (permalink / raw)
To: ltp
run_child flag is commonly used by aiodio tests in order to check if
tests are passed or not and compiler seems to optimize run_child flag
because it's not defined as volatile. With this patch we ensure that the
flag is set as volatile so tests will work as expected on s390.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
---
testcases/kernel/io/ltp-aiodio/aiodio_append.c | 4 ++--
testcases/kernel/io/ltp-aiodio/aiodio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_append.c | 7 +++++--
testcases/kernel/io/ltp-aiodio/dio_sparse.c | 4 ++--
testcases/kernel/io/ltp-aiodio/dio_truncate.c | 4 ++--
5 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_append.c
b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
index 46cc74ee4..e42c577cd 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
@@ -24,7 +24,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -133,7 +133,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
index 2aa5662bb..9aa9b8d54 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
@@ -28,7 +28,7 @@
#include <libaio.h>
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -181,7 +181,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_append.c
b/testcases/kernel/io/ltp-aiodio/dio_append.c
index c099793f6..3a7e7c836 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_append.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
@@ -19,7 +19,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -49,7 +49,10 @@ static void setup(void)
static void cleanup(void)
{
- SAFE_MUNMAP(run_child, sizeof(int));
+ if (run_child) {
+ *run_child = 0;
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
+ }
}
static void run(void)
diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
index 0039daa8d..661afde4c 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
@@ -26,7 +26,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_writesize;
@@ -85,7 +85,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
index 1fbf83de0..0fe6b87ac 100644
--- a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
+++ b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
@@ -33,7 +33,7 @@
#include "tst_test.h"
#include "common.h"
-static int *run_child;
+static volatile int *run_child;
static char *str_numchildren;
static char *str_filesize;
@@ -109,7 +109,7 @@ static void cleanup(void)
{
if (run_child) {
*run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ SAFE_MUNMAP((void *)run_child, sizeof(int));
}
}
--
2.36.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-05-20 12:01 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 17:41 [LTP] [PATCH v1] Fix ltp-aiodio tests failing on s390 Andrea Cervesato
2022-05-20 7:30 ` Petr Vorel
2022-05-20 8:10 ` Andrea Cervesato via ltp
2022-05-20 9:19 ` Cyril Hrubis
2022-05-20 12:01 ` Petr Vorel
-- strict thread matches above, loose matches on Subject: below --
2022-05-19 13:12 Andrea Cervesato via ltp
2022-05-19 14:00 ` Cyril Hrubis
2022-05-19 12:19 Andrea Cervesato via ltp
2022-05-19 12:54 ` 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.