syscall: set FORK in tst_sig for some old tests
PATCH 1/1 syscall: set FORK in tst_sig for some old tests
From: Li Wang <[email protected]>
Since commit d90d2004657b ("lib: Use backoff polling to wait for loop device nodes") use TST_RETRY_FN_EXP_BACKOFF(), which calls tst_multiply_timeout(). That in turn reaches tst_has_slow_kconfig() -> tst_kconfig_read() -> popen("zcat /proc/config.gz") to read the kernel config.
popen() forks a child, and that child exits the SIGCHLD is reported as an unexpected signal by the tst_sig(NOFORK) handler:
umount2_01 1 TBROK : tst_sig.c:232: unexpected signal SIGCHLD(17) received
Since these tests now genuinely fork (indirectly via popen), declaring FORK matches their actual behavior and lets the handler tolerate the child's SIGCHLD. This is a minimal fix that preserves the retry logic.
These are old-API tests that will eventually be converted to the new tst_test API and this issue disappears entirely. The one-line FORK change is a low-cost bridge until then.
---
Notes:
This is a temporary solution for the regression, I will convert these old tests to the new API next few days.
testcases/kernel/syscalls/linkat/linkat02.c | 2 +- testcases/kernel/syscalls/mknodat/mknodat02.c | 2 +- testcases/kernel/syscalls/rename/rename11.c | 2 +- testcases/kernel/syscalls/renameat/renameat01.c | 2 +- testcases/kernel/syscalls/umount2/umount2_01.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
testcases/kernel/syscalls/linkat/linkat02.c +1 -1
@@ -140,7 +140,7 @@ static void setup(void) {tst_require_root (); -tst_sig (NOFORK ,DEF_HANDLER , cleanup); +tst_sig (FORK ,DEF_HANDLER , cleanup);tst_tmpdir ();
testcases/kernel/syscalls/mknodat/mknodat02.c +1 -1
@@ -107,7 +107,7 @@ static void setup(void)tst_require_root (); -tst_sig (NOFORK ,DEF_HANDLER , cleanup); +tst_sig (FORK ,DEF_HANDLER , cleanup);tst_tmpdir ();
testcases/kernel/syscalls/rename/rename11.c +1 -1
@@ -90,7 +90,7 @@ static void setup(void) {int i; -tst_sig (NOFORK ,DEF_HANDLER , cleanup); +tst_sig (FORK ,DEF_HANDLER , cleanup);tst_require_root ();
testcases/kernel/syscalls/renameat/renameat01.c +1 -1
@@ -134,7 +134,7 @@ static void setup(void)tst_require_root (); -tst_sig (NOFORK ,DEF_HANDLER , cleanup); +tst_sig (FORK ,DEF_HANDLER , cleanup);tst_tmpdir ();
testcases/kernel/syscalls/umount2/umount2_01.c +1 -1
@@ -67,7 +67,7 @@ static void setup(void) {tst_require_root (); -tst_sig (NOFORK ,DEF_HANDLER ,NULL ); +tst_sig (FORK ,DEF_HANDLER ,NULL );tst_tmpdir ();
Signature · 5 lines
2.55.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li,
Quoted 1 line · Li Wang
syscall: set FORK in
tst_sigfor some old tests
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li,
Thank you for addressing this.
Petr,
I think we should use this solution instead of reverting the patch.
Regards,
Avinesh
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
Quoted 3 lines
Hi Li,
Thank you for addressing this.
Li, thanks for fixing it!
Quoted 4 lines
Reviewed-by Avinesh Kumar <[email protected]>Petr,
I think we should use this solution instead of reverting the patch.
+1, thanks for a notification
Kind regards,
Petr
Quoted 2 lines
Regards,
Avinesh
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Petr, All,
Quoted 2 lines
Reviewed-by Petr Vorel <[email protected]>Tested-by Petr Vorel <[email protected]>
Patch merged! Thanks~
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li,
Quoted 6 lines
Hi Petr, All,
Quoted 2 lines
Reviewed-by Petr Vorel <[email protected]>Tested-by Petr Vorel <[email protected]>Patch merged! Thanks~
Thanks for fixing it!
very nit: there could have been
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Avinesh, Petr,
Quoted 6 lines
Quoted 1 line
Patch merged! Thanks~
Thanks for fixing it!
very nit: there could have been
Reported-by Avinesh Kumar <[email protected]>
That's true, apologies for my carelessness.
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Quoted 10 lines · Li Wang
Hi Avinesh, Petr,
Quoted 6 lines
Quoted 1 line
Patch merged! Thanks~
Thanks for fixing it!
very nit: there could have been
Reported-by Avinesh Kumar <[email protected]>That's true, apologies for my carelessness.
No worries at all! I've already credited Claude in my private journal anyway ;)
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Li, Petr, Avinesh,
Thanks Li for the quick analysis and for proposing this patch. I agree that this approach is much better than reverting d90d2004657b.
Best regards,
Wake
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp