[llvm] [CAS] Read a CAS file's reserved size from st_blocks, not st_blksize (PR #224104)

Steven Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 12:45:56 PDT 2026


https://github.com/cachemeifyoucan updated https://github.com/llvm/llvm-project/pull/224104

>From 22b600967674935ad5eb1626c57913d5e3c6001d Mon Sep 17 00:00:00 2001
From: Steven Wu <stevenwu at apple.com>
Date: Wed, 16 Sep 2026 10:59:00 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7
---
 llvm/lib/CAS/MappedFileRegionArena.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CAS/MappedFileRegionArena.cpp b/llvm/lib/CAS/MappedFileRegionArena.cpp
index 697461f5d5c48..7fd5015465079 100644
--- a/llvm/lib/CAS/MappedFileRegionArena.cpp
+++ b/llvm/lib/CAS/MappedFileRegionArena.cpp
@@ -429,7 +429,7 @@ ErrorOr<FileSizeInfo> FileSizeInfo::get(sys::fs::file_t File) {
   int StatRet = sys::RetryAfterSignal(-1, ::fstat, File, &Status);
   if (StatRet)
     return errnoAsErrorCode();
-  uint64_t AllocatedSize = uint64_t(Status.st_blksize) * MAPPED_FILE_BSIZE;
+  uint64_t AllocatedSize = uint64_t(Status.st_blocks) * MAPPED_FILE_BSIZE;
   return FileSizeInfo{uint64_t(Status.st_size), AllocatedSize};
 #else
   // Fallback: assume the file is fully allocated. Note: this may result in



More information about the llvm-commits mailing list