summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2021-11-20 02:15:51 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-11-20 02:15:51 +0000
commit4f8df2c51a3101b4aaacdf883b1a636fbbf4742f (patch)
tree6c3ea4d88fee920b9d9b86bb8f2e784bfe0b8c3e
parent3ad0aa3e0171dd42a4499476d856a40d91115413 (diff)
parent4b9691c72746934ce86a56436a29b7e18e27c881 (diff)
Merge "Migrate mount/umount operations to a dedicated mMountsLock." am: b78dbeae20 am: 4b9691c727
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1897160 Change-Id: Id96a1dd871f95385fd2d621d1ffcacedd0c17213
-rw-r--r--cmds/installd/InstalldNativeService.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index f35abda7e3..9ee1cc134c 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -3011,8 +3011,9 @@ binder::Status InstalldNativeService::tryMountDataMirror(
const char* uuid_ = uuid->c_str();
+ std::lock_guard<std::recursive_mutex> lock(mMountsLock);
+
std::string mirrorVolCePath(StringPrintf("%s/%s", kDataMirrorCePath, uuid_));
- std::lock_guard<std::recursive_mutex> lock(mLock);
if (fs_prepare_dir(mirrorVolCePath.c_str(), 0711, AID_SYSTEM, AID_SYSTEM) != 0) {
return error("Failed to create CE mirror");
}
@@ -3081,8 +3082,9 @@ binder::Status InstalldNativeService::onPrivateVolumeRemoved(
std::string mirrorCeVolPath(StringPrintf("%s/%s", kDataMirrorCePath, uuid_));
std::string mirrorDeVolPath(StringPrintf("%s/%s", kDataMirrorDePath, uuid_));
+ std::lock_guard<std::recursive_mutex> lock(mMountsLock);
+
// Unmount CE storage
- std::lock_guard<std::recursive_mutex> lock(mLock);
if (TEMP_FAILURE_RETRY(umount(mirrorCeVolPath.c_str())) != 0) {
if (errno != ENOENT) {
res = error(StringPrintf("Failed to umount %s %s", mirrorCeVolPath.c_str(),