From 459ca0be74ca58a3b221750dfcac7e856f906667 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Tue, 10 Mar 2020 09:07:14 -0700 Subject: [PATCH] Revert "Stop & Resume property service when switching to bootstrap namespace" Dependent change was reverted. This reverts commit 352ae2d225cd78248cdb0c5cbf829a49ed227e75. Bug: 150863651 Test: build Change-Id: I2e11b782fcd2b7baded133a841fdcf519f702b84 --- init/mount_namespace.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/init/mount_namespace.cpp b/init/mount_namespace.cpp index 21750754e..aa368492d 100644 --- a/init/mount_namespace.cpp +++ b/init/mount_namespace.cpp @@ -323,20 +323,10 @@ bool SwitchToBootstrapMountNamespaceIfNeeded() { } if (bootstrap_ns_id != GetMountNamespaceId() && bootstrap_ns_fd.get() != -1 && IsApexUpdatable()) { - // The property service thread and its descendent threads must be in the correct mount - // namespace to call Service::Start(), however setns() only operates on a single thread and - // fails when secondary threads attempt to join the same mount namespace. Therefore, we - // must join the property service thread and its descendents before the setns() call. Those - // threads are then started again after the setns() call, and they'll be in the proper - // namespace. - PausePropertyService(); - if (setns(bootstrap_ns_fd.get(), CLONE_NEWNS) == -1) { PLOG(ERROR) << "Failed to switch to bootstrap mount namespace."; return false; } - - ResumePropertyService(); } return true; }