aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/blockstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/blockstore.cpp')
-rw-r--r--src/zenstore/blockstore.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/zenstore/blockstore.cpp b/src/zenstore/blockstore.cpp
index 69487f9dc..a576ff022 100644
--- a/src/zenstore/blockstore.cpp
+++ b/src/zenstore/blockstore.cpp
@@ -482,7 +482,11 @@ BlockStore::TryGetChunk(const BlockStoreLocation& Location) const
{
if (const Ref<BlockStoreFile>& Block = BlockIt->second; Block)
{
- return Block->GetChunk(Location.Offset, Location.Size);
+ IoBuffer Chunk = Block->GetChunk(Location.Offset, Location.Size);
+ if (Chunk.GetSize() == Location.Size)
+ {
+ return Chunk;
+ }
}
}
return IoBuffer();
@@ -911,7 +915,7 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot,
NewBlockFile = nullptr;
}
}
- catch (std::system_error& SystemError)
+ catch (const std::system_error& SystemError)
{
if (IsOOM(SystemError.code()))
{
@@ -926,11 +930,11 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot,
ZEN_ERROR("reclaiming space for '{}' failed with system error exception: '{}'", m_BlocksBasePath, SystemError.what());
}
}
- catch (std::bad_alloc& BadAlloc)
+ catch (const std::bad_alloc& BadAlloc)
{
ZEN_WARN("reclaiming space for '{}' ran out of memory: '{}'", m_BlocksBasePath, BadAlloc.what());
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
ZEN_ERROR("reclaiming space for '{}' failed with: '{}'", m_BlocksBasePath, ex.what());
}