From owner-svn-src-stable-10@freebsd.org Sat Jan 9 18:07:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5736DA6996A; Sat, 9 Jan 2016 18:07:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32CF01C9A; Sat, 9 Jan 2016 18:07:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09I7nbb071811; Sat, 9 Jan 2016 18:07:49 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09I7n48071808; Sat, 9 Jan 2016 18:07:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091807.u09I7n48071808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 18:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293600 - in stable/10/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 18:07:50 -0000 Author: dchagin Date: Sat Jan 9 18:07:48 2016 New Revision: 293600 URL: https://svnweb.freebsd.org/changeset/base/293600 Log: MFC r283544: When I merged the lemul branch I missied kib@'s r282708 commit. This is not the final fix as I need properly cleanup thread resources before other threads suicide. Modified: stable/10/sys/amd64/linux32/linux32_machdep.c stable/10/sys/compat/linux/linux_emul.c stable/10/sys/i386/linux/linux_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/amd64/linux32/linux32_machdep.c Sat Jan 9 18:07:48 2016 (r293600) @@ -126,7 +126,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *path; int error; @@ -137,19 +136,11 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), path); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(path, M_TEMP); - return (error); - } error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); free(path, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); } Modified: stable/10/sys/compat/linux/linux_emul.c ============================================================================== --- stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/compat/linux/linux_emul.c Sat Jan 9 18:07:48 2016 (r293600) @@ -172,27 +172,19 @@ linux_common_execve(struct thread *td, s { struct linux_pemuldata *pem; struct epoll_emuldata *emd; + struct vmspace *oldvmspace; struct linux_emuldata *em; struct proc *p; int error; p = td->td_proc; - /* - * Unlike FreeBSD abort all other threads before - * proceeding exec. - */ - PROC_LOCK(p); - /* See exit1() comments. */ - thread_suspend_check(0); - while (p->p_flag & P_HADTHREADS) { - if (!thread_single(p, SINGLE_EXIT)) - break; - thread_suspend_check(0); - } - PROC_UNLOCK(p); + error = pre_execve(td, &oldvmspace); + if (error != 0) + return (error); error = kern_execve(td, eargs, NULL); + post_execve(td, error, oldvmspace); if (error != 0) return (error); Modified: stable/10/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 18:06:38 2016 (r293599) +++ stable/10/sys/i386/linux/linux_machdep.c Sat Jan 9 18:07:48 2016 (r293600) @@ -104,7 +104,6 @@ int linux_execve(struct thread *td, struct linux_execve_args *args) { struct image_args eargs; - struct vmspace *oldvmspace; char *newpath; int error; @@ -115,19 +114,11 @@ linux_execve(struct thread *td, struct l printf(ARGS(execve, "%s"), newpath); #endif - error = pre_execve(td, &oldvmspace); - if (error != 0) { - free(newpath, M_TEMP); - return (error); - } error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE, args->argp, args->envp); free(newpath, M_TEMP); if (error == 0) - error = kern_execve(td, &eargs, NULL); - if (error == 0) error = linux_common_execve(td, &eargs); - post_execve(td, error, oldvmspace); return (error); }