diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenstore/blockstore.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp index ec7924553..77d21834a 100644 --- a/src/zenstore/blockstore.cpp +++ b/src/zenstore/blockstore.cpp @@ -113,12 +113,14 @@ BlockStoreFile::Create(uint64_t InitialSize) uint64_t BlockStoreFile::FileSize() const { - if (m_CachedFileSize == 0) + uint64_t CachedSize = m_CachedFileSize; + if (CachedSize == 0) { std::error_code Ec; uint64_t Size = m_File.FileSize(Ec); if (Ec) { + ZEN_WARN("Failed to get file size of block {}. Reason: {}", m_Path, Ec.message()); return 0; } uint64_t Expected = 0; @@ -129,7 +131,7 @@ BlockStoreFile::FileSize() const } return Size; } - return m_CachedFileSize; + return CachedSize; } void @@ -725,6 +727,14 @@ BlockStore::HasChunk(const BlockStoreLocation& Location) const { return true; } + else + { + ZEN_WARN("BlockLocation: Block {}, Offset {}, Size {} is outside block size {}", + Location.BlockIndex, + Location.Offset, + Location.Size, + BlockSize); + } } } return false; |