From fb53d1685c7eca283a4f7bb13e2b45be529db29e Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 12 Apr 2022 09:57:38 +0200 Subject: Be more strict with m_TotalSize atomic operations --- zenstore/compactcas.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zenstore/compactcas.cpp') diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index 51fe7a901..ce93a3320 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -330,7 +330,7 @@ CasContainerStrategy::InsertChunk(const void* ChunkData, size_t ChunkSize, const WriteBlock->Write(ChunkData, ChunkSize, InsertOffset); m_CasLog.Append(IndexEntry); - m_TotalSize.fetch_add(static_cast(ChunkSize), std::memory_order_release); + m_TotalSize.fetch_add(static_cast(ChunkSize), std::memory_order_seq_cst); { RwLock::ExclusiveLockScope __(m_LocationMapLock); m_LocationMap.emplace(ChunkHash, Location); @@ -1484,7 +1484,7 @@ CasContainerStrategy::OpenContainer(bool IsNewStore) for (const auto& Entry : m_LocationMap) { const BlockStoreDiskLocation& Location = Entry.second; - m_TotalSize.fetch_add(Location.GetSize(), std::memory_order_release); + m_TotalSize.fetch_add(Location.GetSize(), std::memory_order_seq_cst); KnownBlocks.insert(Location.GetBlockIndex()); } -- cgit v1.2.3