summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi-Yo Chiang <yochiang@google.com>2021-02-17 10:18:59 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-17 10:18:59 +0000
commit7cf2e769b6b96cff8008faab5b6cb45b8ed38d0e (patch)
tree6c4b0a188949657ddaed694ea4262d72deaeec63
parent524f1cf0d25a9c4e9a4178fbc5e4ffe79dee1a2f (diff)
parent99e0277ae43d66c8c755acc2c0ccd63b8a899af8 (diff)
downloadgsid-7cf2e769b6b96cff8008faab5b6cb45b8ed38d0e.tar.gz
Explicitly cast to 64bit integer when calculating filesystem size am: 23a996fde1 am: 99e0277ae4
Original change: https://android-review.googlesource.com/c/platform/system/gsid/+/1585024 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: If4c434f9421b63b01f00dd821e4a52c43d4fbbe1
-rw-r--r--partition_installer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/partition_installer.cpp b/partition_installer.cpp
index fea1483..79af71a 100644
--- a/partition_installer.cpp
+++ b/partition_installer.cpp
@@ -126,8 +126,8 @@ int PartitionInstaller::PerformSanityChecks() {
// This is the same as android::vold::GetFreebytes() but we also
// need the total file system size so we open code it here.
- uint64_t free_space = 1ULL * sb.f_bavail * sb.f_frsize;
- uint64_t fs_size = sb.f_blocks * sb.f_frsize;
+ uint64_t free_space = static_cast<uint64_t>(sb.f_bavail) * sb.f_frsize;
+ uint64_t fs_size = static_cast<uint64_t>(sb.f_blocks) * sb.f_frsize;
if (free_space <= (size_)) {
LOG(ERROR) << "not enough free space (only " << free_space << " bytes available)";
return IGsiService::INSTALL_ERROR_NO_SPACE;