[LTP] [PATCH] syscalls/fanotify: Kill the child process before exit

zhaogongyi zhaogongyi@huawei.com
Fri Nov 5 10:03:22 CET 2021


Hi,

I have resubmit a patch as your review. Please see: https://patchwork.ozlabs.org/project/ltp/patch/20211105090200.103485-1-zhaogongyi@huawei.com/

Thanks so much!
Gongyi

> 
> 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.


More information about the ltp mailing list