From 6e12b3887e2b964124ab1ba73f84f8049f932df7 Mon Sep 17 00:00:00 2001 From: Keun-young Park Date: Mon, 17 Jul 2017 12:20:33 -0700 Subject: [PATCH] Do not umount /vendor, /system, and /oem even if they are R/W. - /vendor, /system, /oem can be remounted to R/W for development purpose. - In such case, umounting these partitions can lead into some processes not running properly during shutdown or blocking umount of fs. - So skip them. As it is dev feature, it is up to each developer to understand the risk. But for normal adb sync - reboot should be ok as shutdown involves sync operations. bug: 37737296 Test: adb remount,reboot, and check last kmsg Change-Id: Iab6a6374bc558375d359b3b49b14db93d363b1ad --- init/reboot.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init/reboot.cpp b/init/reboot.cpp index 969caec9d..8196d58ed 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -234,7 +234,12 @@ static bool FindPartitionsToUmount(std::vector* blockDevPartitions, LOG(INFO) << "mount entry " << mentry->mnt_fsname << ":" << mentry->mnt_dir << " opts " << mentry->mnt_opts << " type " << mentry->mnt_type; } else if (MountEntry::IsBlockDevice(*mentry) && hasmntopt(mentry, "rw")) { - blockDevPartitions->emplace(blockDevPartitions->begin(), *mentry); + std::string mount_dir(mentry->mnt_dir); + // These are R/O partitions changed to R/W after adb remount. + // Do not umount them as shutdown critical services may rely on them. + if (mount_dir != "/system" && mount_dir != "/vendor" && mount_dir != "/oem") { + blockDevPartitions->emplace(blockDevPartitions->begin(), *mentry); + } } else if (MountEntry::IsEmulatedDevice(*mentry)) { emulatedPartitions->emplace(emulatedPartitions->begin(), *mentry); }