From: Petr Vorel <pvorel@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Matthew Bobrowski <repnop@google.com>,
"ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] syscalls/fanotify: Kill the child process before exit
Date: Fri, 5 Nov 2021 09:29:25 +0100 [thread overview]
Message-ID: <YYTrZa/SEZfqANTn@pevik> (raw)
In-Reply-To: <CAOQ4uxgN2Wx6aAcWYqSO_LNir5hTpAYhPEXHQPqhkQcpeHCPkQ@mail.gmail.com>
Hi all,
...
> This would be the obvious solution.
> But simpler to skip zero values then stop the iterator.
+1
> This makes the cleanup helper reenetrant:
> static int stop_children(void)
> {
> int child_ret;
> int i, ret = 0;
> for (i = 0; i < MAX_CHILDREN; i++) {
> if (!child_pid[i]) continue;
> SAFE_KILL(child_pid[i], SIGKILL);
> }
> for (i = 0; i < MAX_CHILDREN; i++) {
> if (!child_pid[i]) continue;
> SAFE_WAITPID(child_pid[i], &child_ret, 0);
> if (!WIFSIGNALED(child_ret))
> ret = 1;
> child_pid[i] = 0;
> }
> return ret;
> }
Amir, thanks! Zhao, could you please test this in your setup?
(+ please be verbose about your setup, it helps to decide in the future that fix
is still needed).
Kind regards,
Petr
> Thanks,
> Amir.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-11-05 8:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 2:22 [LTP] [PATCH] syscalls/fanotify: Kill the child process before exit zhaogongyi
2021-11-05 3:01 ` Matthew Bobrowski via ltp
2021-11-05 4:31 ` Amir Goldstein
2021-11-05 8:29 ` Petr Vorel [this message]
2021-11-05 8:12 ` Petr Vorel
-- strict thread matches above, loose matches on Subject: below --
2021-11-05 9:03 zhaogongyi
2021-11-04 12:19 Zhao Gongyi
2021-11-04 18:37 ` Petr Vorel
2021-11-05 1:40 ` Matthew Bobrowski via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YYTrZa/SEZfqANTn@pevik \
--to=pvorel@suse.cz \
--cc=amir73il@gmail.com \
--cc=ltp@lists.linux.it \
--cc=repnop@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox