public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* potential set_child_tid/clear_child_tid bug
@ 2003-06-19 19:37 David Mosberger
  2003-06-19 19:57 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: David Mosberger @ 2003-06-19 19:37 UTC (permalink / raw)
  To: drepper, mingo; +Cc: linux-kernel

At the moment, if you don't set CLONE_CHILD_SETTID/CLONE_CHILD_CLEARTID,
the {set,clear}_child_tid values get inherited from the parent task.
I may be missing something, but I suspect that's not the intended behavior.
The patch below instead clears the respective members.

	--david

diff -Nru a/kernel/fork.c b/kernel/fork.c
--- a/kernel/fork.c	Thu Jun 19 12:20:17 2003
+++ b/kernel/fork.c	Thu Jun 19 12:20:17 2003
@@ -889,11 +889,15 @@
 
 	if (clone_flags & CLONE_CHILD_SETTID)
 		p->set_child_tid = child_tidptr;
+	else
+		p->set_child_tid = NULL;
 	/*
 	 * Clear TID on mm_release()?
 	 */
 	if (clone_flags & CLONE_CHILD_CLEARTID)
 		p->clear_child_tid = child_tidptr;
+	else
+		p->clear_child_tid = NULL;
 
 	/*
 	 * Syscall tracing should be turned off in the child regardless

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: potential set_child_tid/clear_child_tid bug
  2003-06-19 19:37 potential set_child_tid/clear_child_tid bug David Mosberger
@ 2003-06-19 19:57 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-06-19 19:57 UTC (permalink / raw)
  To: davidm; +Cc: mingo, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Mosberger wrote:
> At the moment, if you don't set CLONE_CHILD_SETTID/CLONE_CHILD_CLEARTID,
> the {set,clear}_child_tid values get inherited from the parent task.
> I may be missing something, but I suspect that's not the intended behavior.

Your change certainly creates the behavior I'd expect.  I always thought
it is already the case.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+8hWw2ijCOnn/RHQRAsP7AJ4gDQx1iTrvBXn7z4QV2ZtyQCQ67ACgqQ6v
VtwMo6ATImKddiwrNER0+sI=
=542N
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-19 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-19 19:37 potential set_child_tid/clear_child_tid bug David Mosberger
2003-06-19 19:57 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox