From 3c426b65f6fbb98498a40cf3fcc383668ca46e84 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 12 Nov 2018 11:26:10 -0800 Subject: [PATCH] init: error log on by-name identical replacement The following message creates unnecessary alarm: init: Partition system_a already existed in the by-name symlink map \ with a value of \ /dev/block/platform/soc/1d84000.ufshc/by-name/system_a, new value \ /dev/block/platform/soc/1d84000.ufshc/by-name/system_a will be \ ignored. and in the code is cited as an ERROR. The message admittedly does point out an inefficiency by reporting multiple updates. Test: compile Change-Id: I388a76fa078cf9de5840930247f732d16ccb0719 --- init/first_stage_mount.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/first_stage_mount.cpp b/init/first_stage_mount.cpp index a8b786260..1e434d240 100644 --- a/init/first_stage_mount.cpp +++ b/init/first_stage_mount.cpp @@ -560,7 +560,7 @@ ListenerAction FirstStageMountVBootV2::UeventCallback(const Uevent& uevent) { std::vector links = device_handler_->GetBlockDeviceSymlinks(uevent); if (!links.empty()) { auto [it, inserted] = by_name_symlink_map_.emplace(uevent.partition_name, links[0]); - if (!inserted) { + if (!inserted && (links[0] != it->second)) { LOG(ERROR) << "Partition '" << uevent.partition_name << "' already existed in the by-name symlink map with a value of '" << it->second << "', new value '" << links[0] << "' will be ignored.";