fanotify25: fix test failure on kernel with CONFIG_MODULES=n
PATCH 1/1 fanotify25: fix test failure on kernel with CONFIG_MODULES=n
On a kernel built without modules loading support the test fails:
fanotify25.c:61: TBROK: write(4,0x55a523b99160,31) failed: EINVAL (22)
Use another symbol which is less likely to be missing.
--- testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify25.c +4 -4
@@ -24,10 +24,10 @@ static const struct traceconfig {const char *filename;const char *wdata; } trace_cmds[] = { - {EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"}, - {EVENTS_SYSFILE, "-:ltp_load_module_0"}, + {EVENTS_SYSFILE, "p:ltp_load_script_0 load_script"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_load_script_0"}, {} };
Signature · 5 lines
2.53.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 11 lines
Signed-off-by Amir Goldstein <[email protected]>--- testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)testcases/kernel/syscalls/fanotify/fanotify25.c +0
-0@@ -24,10 +24,10 @@ static const struct traceconfig {const char *filename;
testcases/kernel/syscalls/fanotify/fanotify25.c static const struct traceconfig { · line 30
Quoted 10 lines
testcases/kernel/syscalls/fanotify/fanotify25.c +4
-4const char *wdata; } trace_cmds[] = { - {EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"}, - {EVENTS_SYSFILE, "-:ltp_load_module_0"}, + {EVENTS_SYSFILE, "p:ltp_load_script_0 load_script"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_load_script_0"},
Doesn't this depend on CONFIG_BINFMT_SCRIPT? How likely is that this is turned off?
If possible I would like to avoid whack-a-mole game trying to find something that is commonly enabled.
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 18 lines · Cyril Hrubis
Hi!
Quoted 16 lines
Signed-off-by Amir Goldstein <[email protected]>--- testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)testcases/kernel/syscalls/fanotify/fanotify25.c +0
-3@@ -24,10 +24,10 @@ static const struct traceconfig {const char *filename;const char *wdata; } trace_cmds[] = { - {EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"},
Quoted 8 lines
testcases/kernel/syscalls/fanotify/fanotify25.c static const struct traceconfig { · line 30
Quoted 5 lines
testcases/kernel/syscalls/fanotify/fanotify25.c +4
-1- {EVENTS_SYSFILE, "-:ltp_load_module_0"}, + {EVENTS_SYSFILE, "p:ltp_load_script_0 load_script"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_load_script_0"},Doesn't this depend on
CONFIG_BINFMT_SCRIPT? How likely is that this is turned off?
CONFIG_MODULES=n is a common config for testing I don't think this is the case for CONFIG_BINFMT_SCRIPT
Quoted 3 lines
If possible I would like to avoid whack-a-mole game trying to find something that is commonly enabled.
Feel free to choose any other symbol.
Thanks,
Amir.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
Reviewed-byQuoted 28 lines · Cyril Hrubis
Quoted 18 lines
Hi!
Quoted 16 lines
Signed-off-by Amir Goldstein <[email protected]>--- testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)testcases/kernel/syscalls/fanotify/fanotify25.c +0
-3@@ -24,10 +24,10 @@ static const struct traceconfig {const char *filename;const char *wdata; } trace_cmds[] = { - {EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"},Quoted 8 lines
testcases/kernel/syscalls/fanotify/fanotify25.c static const struct traceconfig { · line 30
Quoted 5 lines
testcases/kernel/syscalls/fanotify/fanotify25.c +4
-1- {EVENTS_SYSFILE, "-:ltp_load_module_0"}, + {EVENTS_SYSFILE, "p:ltp_load_script_0 load_script"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_load_script_0"},Doesn't this depend on
CONFIG_BINFMT_SCRIPT? How likely is that this is turned off?
Quoted 2 lines
CONFIG_MODULES=nis a common config for testing I don't think this is the case forCONFIG_BINFMT_SCRIPT
Yes, it's default y and just briefly checking it's in Tumbleweed and Debian testing => LGTM.
Kind regards,
Petr
Quoted 7 lines
Quoted 2 lines
If possible I would like to avoid whack-a-mole game trying to find something that is commonly enabled.
Feel free to choose any other symbol.
Thanks,
Amir.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 5 lines · Amir Goldstein
Quoted 2 lines · Cyril Hrubis
If possible I would like to avoid whack-a-mole game trying to find something that is commonly enabled.
Feel free to choose any other symbol.
Hi,
how about oom_kill_process()? That one's unconditionally available and shouldn't get called very often in a reasonable test environment either.
I'll prepare a patch and check that it still triggers the expected failures on broken kernels.
Signature · 10 lines
Martin Doucha [email protected] SW Quality Engineer SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 11 lines · Martin Doucha
Quoted 5 lines · Amir Goldstein
Quoted 2 lines · Cyril Hrubis
If possible I would like to avoid whack-a-mole game trying to find something that is commonly enabled.
Feel free to choose any other symbol.
Hi,
how aboutoom_kill_process()? That one's unconditionally available and shouldn't get called very often in a reasonable test environment either.
Why does it matter how much the function gets called? Isn't that irrelevant for the test?
Quoted 3 lines
I'll prepare a patch and check that it still triggers the expected failures on broken kernels.
I really think we are over-thinking this.
The problem with load_module was that some test setup configs do not have it - that's all.
Thanks,
Amir.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 8 lines · Amir Goldstein
Quoted 4 lines · Martin Doucha
Hi,
how aboutoom_kill_process()? That one's unconditionally available and shouldn't get called very often in a reasonable test environment either.Why does it matter how much the function gets called? Isn't that irrelevant for the test?
I've written the test to test a specific fanotify regression. Tracing a syscall that gets called too often could increase system load and change timing of the race which I'm trying to trigger with it.
Signature · 10 lines
Martin Doucha [email protected] SW Quality Engineer SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 8 lines · Martin Doucha
Quoted 6 lines · Amir Goldstein
Quoted 4 lines · Martin Doucha
Hi,
how aboutoom_kill_process()? That one's unconditionally available and shouldn't get called very often in a reasonable test environment either.
Quoted 7 lines
Quoted 2 lines
Why does it matter how much the function gets called? Isn't that irrelevant for the test?
I've written the test to test a specific fanotify regression. Tracing a syscall that gets called too often could increase system load and change timing of the race which I'm trying to trigger with it.
Which fanotify regression?
As a reviewer, I got no indication in the commit message,
Test description, nor in LTP tst_test tags that this is a test for a regression.
I have no objection whatsoever to using any other symbol available in most of the common builds.
Alternatively, the test could test for the desired configuration.
But if the test is meant to track a regression, then *please* document the regression in the test description and the fix commit if such fix exists in LTP tst_test tags.
Thanks,
Amir.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 10 lines · Amir Goldstein
Quoted 4 lines · Martin Doucha
I've written the test to test a specific fanotify regression. Tracing a syscall that gets called too often could increase system load and change timing of the race which I'm trying to trigger with it.
Which fanotify regression?
As a reviewer, I got no indication in the commit message,
Test description, nor in LTPtst_testtags that this is a test for a regression.
Quoted 7 lines
I have no objection whatsoever to using any other symbol available in most of the common builds.
Alternatively, the test could test for the desired configuration.But if the test is meant to track a regression, then *please* document the regression in the test description and the fix commit if such fix exists in LTP
tst_testtags.
The regression in question was not in upstream but a broken backport in a custom kernel branch. It was fixed by reverting the backported patch. So while the test will be useful for detecting similar regressions in upstream, there is nothing I can publicly document about it.
Signature · 10 lines
Martin Doucha [email protected] SW Quality Engineer SUSE LINUX, s.r.o. CORSO IIa Krizikova 148/34 186 00 Prague 8 Czech Republic -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 16 lines · Martin Doucha
Quoted 14 lines · Amir Goldstein
Quoted 4 lines · Martin Doucha
I've written the test to test a specific fanotify regression. Tracing a syscall that gets called too often could increase system load and change timing of the race which I'm trying to trigger with it.
Which fanotify regression?
As a reviewer, I got no indication in the commit message,
Test description, nor in LTPtst_testtags that this is a test for a regression.I have no objection whatsoever to using any other symbol available in most of the common builds.
Alternatively, the test could test for the desired configuration.
Quoted 9 lines
Quoted 3 lines
But if the test is meant to track a regression, then *please* document the regression in the test description and the fix commit if such fix exists in LTP
tst_testtags.The regression in question was not in upstream but a broken backport in a custom kernel branch. It was fixed by reverting the backported patch. So while the test will be useful for detecting similar regressions in upstream, there is nothing I can publicly document about it.
Fair enough, but when choosing the function to trace, please document the reason for choosing this function and document the fact the expectation that this event will not be triggered during the test or will not be triggered too frequently, whichever is the case.
Thanks,
Amir.
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 6 lines · Amir Goldstein
On a kernel built without modules loading support the test fails:
fanotify25.c:61: TBROK:write(4,0x55a523b99160,31)failed: EINVAL (22)Use another symbol which is less likely to be missing.
Signed-off-by Amir Goldstein <[email protected]>
Looks good. Feel free to add:
Honza
Quoted 26 lines
--- testcases/kernel/syscalls/fanotify/fanotify25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)testcases/kernel/syscalls/fanotify/fanotify25.c +4
-4@@ -24,10 +24,10 @@ static const struct traceconfig {const char *filename;const char *wdata; } trace_cmds[] = { - {EVENTS_SYSFILE, "p:ltp_load_module_0 load_module"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "1"}, - {MNTPOINT "/events/kprobes/ltp_load_module_0/enable", "0"}, - {EVENTS_SYSFILE, "-:ltp_load_module_0"}, + {EVENTS_SYSFILE, "p:ltp_load_script_0 load_script"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "1"}, + {MNTPOINT "/events/kprobes/ltp_load_script_0/enable", "0"}, + {EVENTS_SYSFILE, "-:ltp_load_script_0"}, {} };Signature · 1 line
2.53.0
Signature · 5 lines
Jan Kara <[email protected]> SUSE Labs, CR -- Mailing list info: https://lists.linux.it/listinfo/ltp