Skip to contentSkip to conversation

syscalls/fanotify: Kill the child process before exit

PATCH zhaogongyi 1 participant 1 message Nov 5, 2021

lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

Hi,

I have resubmit a patch as your review. Please see: https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Thanks so much!
Gongyi

Quoted 38 lines

Hi all,

...

Quoted 2 lines

This would be the obvious solution.
But simpler to skip zero values then stop the iterator.

+1

Quoted 13 lines

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;
Quoted 8 lines
                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

Quoted 2 lines

Thanks,
Amir.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp