From 7b51190ed332c0c241083a8011544de142502432 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 10 Sep 2020 17:37:56 +0000 Subject: [PATCH] init: do not create dev.mnt. properties for emulated mounts dev.mnt. properties are primarily intended for tuning parameters for mounts such as /system and /data but don't have much use for emulated mounts. There are additional emulated mounts created for each user on a device, so if too many users are created, init would otherwise create too many dev.mnt. properties, filling the property file that backs these properties, and preventing more properties from being generated. Therefore, this change stops init from creating dev.mnt. properties for emulated mounts. Bug: 156721033 Bug: 179111945 Test: user creation stress test doesn't create large numbers of properties Change-Id: I6475956719b7c938b8289189abfef661140d526d (cherry picked from commit 7e4ce2b578b602e171d12dd59c66711b27d5ab73) --- init/mount_handler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init/mount_handler.cpp b/init/mount_handler.cpp index 01abba8d1..46f833104 100644 --- a/init/mount_handler.cpp +++ b/init/mount_handler.cpp @@ -130,7 +130,11 @@ void MountHandler::MountHandlerFunction() { char* buf = nullptr; size_t len = 0; while (getline(&buf, &len, fp_.get()) != -1) { - auto entry = ParseMount(std::string(buf)); + auto buf_string = std::string(buf); + if (buf_string.find("/emulated") != std::string::npos) { + continue; + } + auto entry = ParseMount(buf_string); auto match = untouched.find(entry); if (match == untouched.end()) { touched.emplace_back(std::move(entry));