File size is updated correctly according to 

> fdatasync() is similar to fsync(), but does not flush modified metadata unless that metadata is needed in order to allow a subsequent data retrieval to be correctly handled.  For example, changes to  st_atime  or  st_mtime  (respec‐
       tively,  time  of  last  access  and  time  of last modification; see inode(7)) do not require flushing because they are not necessary for a subsequent data read to be handled correctly.  On the other hand, a change to the file size
       (st_size, as made by say ftruncate(2)), would require a metadata flush.

And we don't care about modification times.
Should work alright.
inline const char * getData() const { return buffer.m_data; }
    inline size_t getSizeInBytes() const { return block_size * partition_blocks_size; }
    void readKeys(PaddedPODArray<KeyType> & keys) const
    {
        SSDCacheBlock block(block_size);
        for (size_t block_index = 0; block_index < partition_blocks_size; ++block_index)
        {
            block.reset(buffer.m_data + (block_index * block_size));
            if constexpr (std::is_same_v<KeyType, UInt64>)
                block.readSimpleKeys(keys);
            else
                block.readComplexKeys(keys);
        }
    }
    inline void reset()
    {
        current_block_index = 0;
        current_write_block.reset(buffer.m_data);
    }
    const size_t block_size;
    const size_t partition_blocks_size;
private:
    Memory<Allocator<true>> buffer;
    SSDCacheBlock current_write_block;
    size_t current_block_index = 0;
};
template <typename SSDCacheKeyType>
class SSDCacheFileBuffer : private boost::noncopyable