Skip to content

Commit

Permalink
storage: treat cache files as uncompressed when the algorithm is None
Browse files Browse the repository at this point in the history
When the compression algorithm is None, treat cache file as uncompressed
even if user configures it as compressed.

Signed-off-by: Jiang Liu <[email protected]>
  • Loading branch information
jiangliu committed Nov 12, 2022
1 parent 5be153f commit fa19172
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/src/cache/filecache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use std::sync::{Arc, RwLock};

use nydus_api::http::{CacheConfig, FileCacheConfig};
use nydus_utils::compress;
use nydus_utils::metrics::BlobcacheMetrics;
use tokio::runtime::Runtime;

Expand Down Expand Up @@ -188,7 +189,7 @@ impl FileCacheEntry {
let compressor = blob_info.compressor();
let digester = blob_info.digester();
let is_legacy_stargz = blob_info.is_legacy_stargz();
let is_compressed = mgr.is_compressed;
let is_compressed = mgr.is_compressed && compressor != compress::Algorithm::None;
let is_zran = blob_info.meta_flags() & BLOB_META_FEATURE_ZRAN != 0;
let need_validation = (mgr.validate || !is_direct_chunkmap) && !is_legacy_stargz;
trace!(
Expand Down

0 comments on commit fa19172

Please sign in to comment.