diff --git a/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h b/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h
index 8add041..97974c4 100644
--- a/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h
+++ b/fs_mgr/libsnapshot/include/libsnapshot/cow_compress.h
@@ -32,9 +32,9 @@
     static std::unique_ptr<ICompressor> Gz(uint32_t compression_level);
     static std::unique_ptr<ICompressor> Brotli(uint32_t compression_level);
     static std::unique_ptr<ICompressor> Lz4(uint32_t compression_level);
-    static std::unique_ptr<ICompressor> Zstd(uint32_t compression_level);
+    static std::unique_ptr<ICompressor> Zstd(uint32_t compression_level, const int32_t BLOCK_SZ);
 
-    static std::unique_ptr<ICompressor> Create(CowCompression compression);
+    static std::unique_ptr<ICompressor> Create(CowCompression compression, const int32_t BLOCK_SZ);
 
     uint32_t GetCompressionLevel() const { return compression_level_; }
 
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/cow_compress.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/cow_compress.cpp
index 466b93c..71ac59f 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/cow_compress.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/cow_compress.cpp
@@ -55,7 +55,8 @@
     }
 }
 
-std::unique_ptr<ICompressor> ICompressor::Create(CowCompression compression) {
+std::unique_ptr<ICompressor> ICompressor::Create(CowCompression compression,
+                                                 const int32_t BLOCK_SZ) {
     switch (compression.algorithm) {
         case kCowCompressLz4:
             return ICompressor::Lz4(compression.compression_level);
@@ -64,7 +65,7 @@
         case kCowCompressGz:
             return ICompressor::Gz(compression.compression_level);
         case kCowCompressZstd:
-            return ICompressor::Zstd(compression.compression_level);
+            return ICompressor::Zstd(compression.compression_level, BLOCK_SZ);
         case kCowCompressNone:
             return nullptr;
     }
@@ -175,12 +176,10 @@
 
 class ZstdCompressor final : public ICompressor {
   public:
-    ZstdCompressor(uint32_t compression_level)
+    ZstdCompressor(uint32_t compression_level, const uint32_t MAX_BLOCK_SIZE)
         : ICompressor(compression_level), zstd_context_(ZSTD_createCCtx(), ZSTD_freeCCtx) {
         ZSTD_CCtx_setParameter(zstd_context_.get(), ZSTD_c_compressionLevel, compression_level);
-        // FIXME: hardcoding a value of 12 here for 4k blocks, should change to be either set by
-        // user, or optimized depending on block size
-        ZSTD_CCtx_setParameter(zstd_context_.get(), ZSTD_c_windowLog, 12);
+        ZSTD_CCtx_setParameter(zstd_context_.get(), ZSTD_c_windowLog, log2(MAX_BLOCK_SIZE));
     };
 
     std::basic_string<uint8_t> Compress(const void* data, size_t length) const override {
@@ -326,8 +325,8 @@
     return std::make_unique<Lz4Compressor>(compression_level);
 }
 
-std::unique_ptr<ICompressor> ICompressor::Zstd(uint32_t compression_level) {
-    return std::make_unique<ZstdCompressor>(compression_level);
+std::unique_ptr<ICompressor> ICompressor::Zstd(uint32_t compression_level, const int32_t BLOCK_SZ) {
+    return std::make_unique<ZstdCompressor>(compression_level, BLOCK_SZ);
 }
 
 void CompressWorker::Finalize() {
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp
index 3692c1a..2aaf388 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/cow_decompress.cpp
@@ -351,7 +351,7 @@
             return decompressed_size;
         }
         std::vector<unsigned char> ignore_buf(decompressed_size);
-        if (!Decompress(buffer, decompressed_size)) {
+        if (!Decompress(ignore_buf.data(), decompressed_size)) {
             return -1;
         }
         memcpy(buffer, ignore_buf.data() + ignore_bytes, buffer_size);
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/cow_reader.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/cow_reader.cpp
index f37aed1..1b5d724 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/cow_reader.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/cow_reader.cpp
@@ -17,9 +17,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <limits>
 #include <optional>
-#include <set>
 #include <unordered_map>
 #include <unordered_set>
 #include <vector>
@@ -103,7 +101,7 @@
     footer_ = parser.footer();
     fd_size_ = parser.fd_size();
     last_label_ = parser.last_label();
-    ops_ = std::move(parser.ops());
+    ops_ = parser.ops();
     data_loc_ = parser.data_loc();
 
     // If we're resuming a write, we're not ready to merge
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/test_v2.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/test_v2.cpp
index 0ecad9d..e59bd92 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/test_v2.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/test_v2.cpp
@@ -480,7 +480,7 @@
     std::string expected = "The quick brown fox jumps over the lazy dog.";
     expected.resize(4096, '\0');
 
-    std::unique_ptr<ICompressor> compressor = ICompressor::Create(compression);
+    std::unique_ptr<ICompressor> compressor = ICompressor::Create(compression, 4096);
     auto result = compressor->Compress(expected.data(), expected.size());
     ASSERT_FALSE(result.empty());
 
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/writer_v2.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/writer_v2.cpp
index 6757fa8..d3c3d59 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/writer_v2.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/writer_v2.cpp
@@ -183,7 +183,8 @@
         return;
     }
     for (int i = 0; i < num_compress_threads_; i++) {
-        std::unique_ptr<ICompressor> compressor = ICompressor::Create(compression_);
+        std::unique_ptr<ICompressor> compressor =
+                ICompressor::Create(compression_, header_.block_size);
         auto wt = std::make_unique<CompressWorker>(std::move(compressor), header_.block_size);
         threads_.emplace_back(std::async(std::launch::async, &CompressWorker::RunThread, wt.get()));
         compress_threads_.push_back(std::move(wt));
@@ -340,7 +341,7 @@
     compressed_buf_.clear();
     if (num_threads <= 1) {
         if (!compressor_) {
-            compressor_ = ICompressor::Create(compression_);
+            compressor_ = ICompressor::Create(compression_, header_.block_size);
         }
         return CompressWorker::CompressBlocks(compressor_.get(), options_.block_size, data,
                                               num_blocks, &compressed_buf_);
@@ -415,7 +416,7 @@
                         return data;
                     } else {
                         if (!compressor_) {
-                            compressor_ = ICompressor::Create(compression_);
+                            compressor_ = ICompressor::Create(compression_, header_.block_size);
                         }
 
                         auto data = compressor_->Compress(iter, header_.block_size);
