eventfd06: add AIO support check
PATCH 1/1 eventfd06: add AIO support check
Just like what we did for io_setup01.c to avoid ENOSYS error:
eventfd06.c:140: TBROK: io_setup() failed: ENOSYS
--- testcases/kernel/syscalls/eventfd/eventfd06.c | 2 ++ 1 file changed, 2 insertions(+)
testcases/kernel/syscalls/eventfd/eventfd06.c +2 -0
@@ -136,6 +136,8 @@ static void test_poll(void)static void setup (void ) {TEST (io_setup (MAXEVENTS , &ctx)); +if (TST_RET == -ENOSYS ) +tst_brk (TCONF |TRERRNO ,"io_setup(): AIO not supported by kernel" );if (TST_RET <0 )tst_brk (TBROK ,"io_setup() failed: %s" ,tst_strerrno (-TST_RET ));
Signature · 5 lines
2.48.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 13 lines
Just like what we did for
io_setup01.cto avoid ENOSYS error:
eventfd06.c:140: TBROK:io_setup()failed: ENOSYSSigned-off-by Li Wang <[email protected]>--- testcases/kernel/syscalls/eventfd/eventfd06.c | 2 ++ 1 file changed, 2 insertions(+)testcases/kernel/syscalls/eventfd/eventfd06.c +0
-0
testcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 139
Quoted 4 lines
testcases/kernel/syscalls/eventfd/eventfd06.c +1
-0@@ -136,6 +136,8 @@ static void test_poll(void)static void setup (void ) {TEST (io_setup (MAXEVENTS , &ctx)); +if (TST_RET == -ENOSYS )
Maybe to be safe to check also TST_RET?
if (TST_RET == -1 && TTERRNO == ENOSYS)
Maybe (after the release) we could add new macro to tst_test_macros.h similar to TEST(), which would do test like this (variant of tst_syscall() macro). We already have 10 tests which do this manually.
Kind regards,
Petr
Quoted 3 lines
testcases/kernel/syscalls/eventfd/eventfd06.c +1
-0+tst_brk (TCONF |TRERRNO ,"io_setup(): AIO not supported by kernel" );if (TST_RET <0 )tst_brk (TBROK ,"io_setup() failed: %s" ,tst_strerrno (-TST_RET ));
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 21 lines · Petr Vorel
Review
Quoted 9 lines
Just like what we did for
io_setup01.cto avoid ENOSYS error:
eventfd06.c:140: TBROK:io_setup()failed: ENOSYSSigned-off-by Li Wang <[email protected]>--- testcases/kernel/syscalls/eventfd/eventfd06.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/testcases/kernel/syscalls/eventfd/eventfd06.ctestcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 139
Quoted 8 lines
index
7339dd471..46d7f73d3100644testcases/kernel/syscalls/eventfd/eventfd06.c +1
-0@@ -136,6 +136,8 @@ static void test_poll(void)static void setup (void ) {TEST (io_setup (MAXEVENTS , &ctx)); +if (TST_RET == -ENOSYS )Reviewed-by Petr Vorel <[email protected]>
Quoted 4 lines
Maybe to be safe to check also
TST_RET?if (
TST_RET== -1 && TTERRNO == ENOSYS)
I guess you mean: if (TST_RET == -1 && TST_ERR == ENOSYS).
Typically this is correct but here it's not right. Because according to the io_setup(2) - Linux man page:
"... Note also that the libaio wrapper does not follow the usual C library conventions for indicating errors: on error it returns a negated error number (the negative of one of the values listed in ERRORS) ... "
Quoted 5 lines
Maybe (after the release) we could add new macro to
tst_test_macros.hsimilar toTEST(), which would do test like this (variant oftst_syscall()macro). We already have 10 tests which do this manually.
Sure.
Quoted 10 lines
Kind regards,
Petrtestcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 140
Quoted 1 line
testcases/kernel/syscalls/eventfd/eventfd06.c +1
-0+ tst_brk(TCONF | TRERRNO, "io_setup(): AIO not supported bykernel");
testcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 142
Quoted 2 lines
testcases/kernel/syscalls/eventfd/eventfd06.c +0
-0if (TST_RET <0 ) tst_brk(TBROK, "io_setup() failed: %s",
tst_strerrno(-TST_RET));
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li,
...
Quoted 10 lines
Quoted 7 lines
Quoted 1 line
+ if (
TST_RET==-ENOSYS)Reviewed-by Petr Vorel <[email protected]>Maybe to be safe to check also
TST_RET?if (
TST_RET== -1 && TTERRNO == ENOSYS)I guess you mean: if (
TST_RET== -1 &&TST_ERR== ENOSYS).
Quoted 7 lines
Typically this is correct but here it's not right. Because according to the
io_setup(2)- Linux man page:"... Note also that the libaio wrapper does not follow the usual C library conventions for indicating errors: on error it returns a negated error number (the negative of one of the values listed in ERRORS) ... "
Ah, I'm sorry, I overlooked that.
I guess Cyril will ack this obvious fix today.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 13 lines
Just like what we did for
io_setup01.cto avoid ENOSYS error:
eventfd06.c:140: TBROK:io_setup()failed: ENOSYSSigned-off-by Li Wang <[email protected]>--- testcases/kernel/syscalls/eventfd/eventfd06.c | 2 ++ 1 file changed, 2 insertions(+)testcases/kernel/syscalls/eventfd/eventfd06.c +0
-0
testcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 143
Quoted 8 lines
testcases/kernel/syscalls/eventfd/eventfd06.c +2
-0@@ -136,6 +136,8 @@ static void test_poll(void)static void setup (void ) {TEST (io_setup (MAXEVENTS , &ctx)); +if (TST_RET == -ENOSYS ) +tst_brk (TCONF |TRERRNO ,"io_setup(): AIO not supported by kernel" );if (TST_RET <0 )tst_brk (TBROK ,"io_setup() failed: %s" ,tst_strerrno (-TST_RET ));
Alternatively we can add CONFIG_AIO to the needs_kconfigs but anyways:
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 21 lines · Cyril Hrubis
Hi!
Review
Quoted 9 lines
Just like what we did for
io_setup01.cto avoid ENOSYS error:
eventfd06.c:140: TBROK:io_setup()failed: ENOSYSSigned-off-by Li Wang <[email protected]>--- testcases/kernel/syscalls/eventfd/eventfd06.c | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/testcases/kernel/syscalls/eventfd/eventfd06.ctestcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 140
Quoted 9 lines
index
7339dd471..46d7f73d3100644testcases/kernel/syscalls/eventfd/eventfd06.c +2
-0@@ -136,6 +136,8 @@ static void test_poll(void)static void setup (void ) {TEST (io_setup (MAXEVENTS , &ctx)); +if (TST_RET == -ENOSYS ) + tst_brk(TCONF | TRERRNO, "io_setup(): AIO not supported bykernel");
Quoted 9 lines
testcases/kernel/syscalls/eventfd/eventfd06.c static void test_poll(void) · line 142
Quoted 2 lines
testcases/kernel/syscalls/eventfd/eventfd06.c +0
-0if (TST_RET <0 ) tst_brk(TBROK, "io_setup() failed: %s",
tst_strerrno(-TST_RET));Quoted 1 line
Alternatively we can add
CONFIG_AIOto theneeds_kconfigsbut anyways:Reviewed-by Cyril Hrubis <[email protected]>
Patch merged, thanks.
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp