Snap for 9430503 from d124371c64409895ac0ed812d9cb6bac074589e4 to t-keystone-qcom-release
Change-Id: I52382f132629968d9eeb53591fe0664e034ca901
diff --git a/incfs/MountRegistry.cpp b/incfs/MountRegistry.cpp
index 4f16f73..376eaf2 100644
--- a/incfs/MountRegistry.cpp
+++ b/incfs/MountRegistry.cpp
@@ -355,7 +355,8 @@
if (mount.backing.empty()) {
mount.backing = std::move(backingDir);
} else if (mount.backing != backingDir) {
- LOG(WARNING) << "[incfs] root '" << *mount.roots.begin()
+ LOG(WARNING) << "[incfs] root '"
+ << (!mount.roots.empty() ? *mount.roots.begin() : "<unknown>")
<< "' mounted in multiple places with different backing dirs, '"
<< mount.backing << "' vs new '" << backingDir
<< "'; updating to the new one";
diff --git a/incfs/include/incfs_inline.h b/incfs/include/incfs_inline.h
index f3d1e89..545a735 100644
--- a/incfs/include/incfs_inline.h
+++ b/incfs/include/incfs_inline.h
@@ -306,9 +306,9 @@
}
inline std::pair<ErrorCode, FilledRanges> getFilledRanges(int fd, FilledRanges&& resumeFrom) {
+ auto totalRanges = resumeFrom.dataRanges().size() + resumeFrom.hashRanges().size();
auto rawRanges = resumeFrom.internalRawRanges();
auto buffer = resumeFrom.extractInternalBufferAndClear();
- auto totalRanges = resumeFrom.dataRanges().size() + resumeFrom.hashRanges().size();
auto remainingSpace = buffer.size() - totalRanges;
const bool loadAll = remainingSpace == 0;
int res;
diff --git a/incfs/tests/util/map_ptr_test.cpp b/incfs/tests/util/map_ptr_test.cpp
index c78d91d..f9c96aa 100644
--- a/incfs/tests/util/map_ptr_test.cpp
+++ b/incfs/tests/util/map_ptr_test.cpp
@@ -325,4 +325,4 @@
auto p1 = map->data().offset(missing_page_start).convert<uint32_t>();
ASSERT_FALSE(p1);
ASSERT_SIGBUS(p1.value());
-}
\ No newline at end of file
+}