diff --git a/rafs/src/builder/core/v5.rs b/rafs/src/builder/core/v5.rs index a357db0cc82..ddfc752aa5d 100644 --- a/rafs/src/builder/core/v5.rs +++ b/rafs/src/builder/core/v5.rs @@ -173,8 +173,7 @@ impl Bootstrap { // Set super block let mut super_block = RafsV5SuperBlock::new(); - let inodes_count = bootstrap_ctx.inode_map.len() as u64; - super_block.set_inodes_count(inodes_count); + super_block.set_inodes_count(inode_table_entries as u64); super_block.set_inode_table_offset(super_block_size as u64); super_block.set_inode_table_entries(inode_table_entries); super_block.set_blob_table_offset(blob_table_offset as u64); diff --git a/rafs/src/metadata/md_v5.rs b/rafs/src/metadata/md_v5.rs index 5964b35b603..5a17bd309bc 100644 --- a/rafs/src/metadata/md_v5.rs +++ b/rafs/src/metadata/md_v5.rs @@ -172,12 +172,12 @@ impl RafsSuper { if let Ok(ni) = self.get_inode(next_ino, false) { if ni.is_reg() { let next_size = ni.size(); - let next_size = if next_size < window_size { + let next_size = if next_size == 0 { + continue; + } else if next_size < window_size { next_size } else if window_size >= self.meta.chunk_size as u64 { window_size / self.meta.chunk_size as u64 * self.meta.chunk_size as u64 - } else if next_size == 0 { - continue; } else { break; };