Skip to contentSkip to conversation

Fix unnecessary tying of CLONE_THREAD and CLONE_PARENT

PATCH Dave McCracken 1 participant 1 message Jan 28, 2002

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Code was added in about 2.4.7 that forced CLONE_PARENT behavior whenever CLONE_THREAD was specified. This was to work around a bug in exit that has since been fixed. It's unnecessary to force this behavior, and in fact breaks some thread programming models. Anyone who wants it can still specify the flags separately.

Here's the patch to put it back the way it should be.

Dave McCracken

======================================================================
Dave McCracken IBM Linux Base Kernel Team 1-512-838-3059
[email protected] T/L 678-3059

--------

./kernel/fork.c +2 -2
@@ -700,10 +700,10 @@
 	/* Need tasklist lock for parent etc handling! */
 	write_lock_irq(&tasklist_lock);
 
-	/* CLONE_PARENT and CLONE_THREAD re-use the old parent */
+	/* CLONE_PARENT re-uses the old parent */
 	p->p_opptr = current->p_opptr;
 	p->p_pptr = current->p_pptr;
-	if (!(clone_flags & (CLONE_PARENT | CLONE_THREAD))) {
+	if (!(clone_flags & CLONE_PARENT)) {
 		p->p_opptr = current;
 		if (!(p->ptrace & PT_PTRACED))
 			p->p_pptr = current;