From a3832d496b2c51e22bd7b4992aa7bfe29f062506 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Tue, 5 Jul 2022 17:55:24 +0800 Subject: [PATCH] first_stage_mount: Fix log typo "check_at_most_once" Was "check_most_at_once", should be "check_at_most_once". Also straighten the if-then-else logic from: if (cond) { // then } else { // error... return; } to: if (!cond) { // error... return; } // fallthrough is "then" Test: Presubmit Change-Id: I85c1e94c47a727089374d5d05ecd40f4187b66a1 --- init/first_stage_mount.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init/first_stage_mount.cpp b/init/first_stage_mount.cpp index 4bbbc20cb..07ce4588d 100644 --- a/init/first_stage_mount.cpp +++ b/init/first_stage_mount.cpp @@ -507,16 +507,16 @@ bool FirstStageMount::TrySwitchSystemAsRoot() { SaveRamdiskPathToSnapuserd(); } - if (MountPartition(system_partition, false /* erase_same_mounts */)) { - if (dsu_not_on_userdata_ && fs_mgr_verity_is_check_at_most_once(*system_partition)) { - LOG(ERROR) << "check_most_at_once forbidden on external media"; - return false; - } - SwitchRoot("/system"); - } else { + if (!MountPartition(system_partition, false /* erase_same_mounts */)) { PLOG(ERROR) << "Failed to mount /system"; return false; } + if (dsu_not_on_userdata_ && fs_mgr_verity_is_check_at_most_once(*system_partition)) { + LOG(ERROR) << "check_at_most_once forbidden on external media"; + return false; + } + + SwitchRoot("/system"); return true; }