diff options
| author | 2021-11-20 00:01:25 +0000 | |
|---|---|---|
| committer | 2021-11-20 00:01:25 +0000 | |
| commit | b78dbeae208e47e37df2fe51941bfa9151d59a54 (patch) | |
| tree | f088c151cd4ab379d9775a5d4b9c9f975bec351e | |
| parent | 9b5c8c3222ca4c541826f30cc67289a5eb43b770 (diff) | |
| parent | 40c45ba78707282017f716abd045062f7be4fa00 (diff) | |
Merge "Migrate mount/umount operations to a dedicated mMountsLock."
| -rw-r--r-- | cmds/installd/InstalldNativeService.cpp | 6 |
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(), |