Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 13:55:24 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364680 - stable/12/sys/compat/linux
Message-ID:  <202008241355.07ODtO9g079865@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Aug 24 13:55:24 2020
New Revision: 364680
URL: https://svnweb.freebsd.org/changeset/base/364680

Log:
  MFC r364329:
  Remove "emulation" of clone(CLONE_PARENT | CLONE_THREAD).

Modified:
  stable/12/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/12/sys/compat/linux/linux_fork.c	Mon Aug 24 13:54:58 2020	(r364679)
+++ stable/12/sys/compat/linux/linux_fork.c	Mon Aug 24 13:55:24 2020	(r364680)
@@ -280,6 +280,8 @@ linux_clone_thread(struct thread *td, struct linux_clo
 	    td->td_tid, (unsigned)args->flags,
 	    args->parent_tidptr, args->child_tidptr);
 
+	if ((args->flags & LINUX_CLONE_PARENT) != 0)
+		return (EINVAL);
 	if (args->flags & LINUX_CLONE_PARENT_SETTID)
 		if (args->parent_tidptr == NULL)
 			return (EINVAL);
@@ -342,12 +344,8 @@ linux_clone_thread(struct thread *td, struct linux_clo
 
 	PROC_LOCK(p);
 	p->p_flag |= P_HADTHREADS;
+	thread_link(newtd, p);
 	bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name));
-
-	if (args->flags & LINUX_CLONE_PARENT)
-		thread_link(newtd, p->p_pptr);
-	else
-		thread_link(newtd, p);
 
 	thread_lock(td);
 	/* let the scheduler know about these things. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008241355.07ODtO9g079865>