Re: [PATCH 2/2] introduce ptrace_reparented() helper

From: Roland McGrath
Date: Tue Mar 04 2008 - 23:19:34 EST


> Somehow the patch I sent misses the change in ptrace.c, it can use the
> new helper too.

Actually, my pedantic streak prefers that to be in a separate patch.

I think the ptrace_reparented cleanup is fine, it is purely cosmetic and
improves readability.

> - if (!list_empty(&child->ptrace_list)) {
> + if (ptrace_reparented(child)) {

This is changing the test from list_empty(&child->ptrace_list)
to child->parent == child->real_parent. It should indeed be
impossible for those tests not to match. But, paranoia is its
own reward. I don't object to the change, but it should be
separate so bisect distinguishes it should it ever turn out to
matter in some way we are now overlooking. I'd even be a
little inclined towards:

if (child->real_parent == child->parent) {
BUG_ON(!list_empty(&child->ptrace_list));
return 0;
} else {
BUG_ON(list_empty(&child->ptrace_list));
return 1;
}

except of course you couldn't use that in the reparent_thread case.


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/