Skip to content

Commit

Permalink
fix: dragonflyoss#1423 zran check fail, because validate_header zran_…
Browse files Browse the repository at this point in the history
…count > chunk_count

1. targz-ref jump deduplicate chunk, because zran hasn't duplication
2. targz-ref rebuild filesystem chunk need not map

Signed-off-by: 伏鸾 <[email protected]>
  • Loading branch information
伏鸾 authored and Desiki-high committed Oct 27, 2023
1 parent f55d2c9 commit 4a252e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion builder/src/core/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ impl Node {
}

// No need to perform chunk deduplication for tar-tarfs case.
if ctx.conversion_type != ConversionType::TarToTarfs {
if ctx.conversion_type != ConversionType::TarToTarfs
&& ctx.conversion_type != ConversionType::TargzToRef
{
chunk = match self.deduplicate_chunk(
ctx,
blob_mgr,
Expand Down
2 changes: 1 addition & 1 deletion rafs/src/metadata/direct_v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ impl RafsInodeExt for OndiskInodeWrapper {
blob_index, chunk_index
))
})
} else if state.is_tarfs() {
} else if state.is_tarfs() || state.meta.has_inlined_chunk_digest() {
let size = if idx == self.get_chunk_count() - 1 {
(self.size() % self.chunk_size() as u64) as u32
} else {
Expand Down

0 comments on commit 4a252e4

Please sign in to comment.