[PR #420] [MERGED] fix(storage): recognize ZFile layers during sparse-upper detection #422

Closed
opened 2026-10-29 14:23:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/420
Author: @guozy18
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @yingdi-shan

Base: main ← Head: sync/zfile-layer-detection


📝 Commits (1)

  • 75611af fix(storage): avoid spurious ZFile and disk size warnings

📊 Changes

2 files changed (+31 additions, -14 deletions)

View changed files

📝 storage/overlaybd/src/compression/zfile.rs (+9 -5)
📝 storage/overlaybd/src/layer/layer_metadata.rs (+22 -9)

📄 Description

What

Recognize a valid ZFile header before parsing an OverlayBD LSMT header when deciding whether a layer is a sparse writable upper.

Why

Compressed layers can be smaller than an LSMT header. Reading a full LSMT header first incorrectly rejects those valid layers or emits misleading diagnostics.

N/A — focused correction of existing behavior.

Scope and non-goals

The existing ZFile header verifier and the sparse-upper detection helper.

Design and behavior changes

Share the existing ZFile header validation, read at most one LSMT header, and return false for a valid compressed layer. Raw LSMT layers keep their header validation and sparse flag checks; truncated or invalid inputs still fail.

Compatibility and operations

No API, configuration or storage-format changes. Existing compressed layers become readable by the detector. Ordinary code upgrade/revert; no data migration or new host requirements.

Validation

This branch is based directly on upstream main a97473b and contains one feature commit with no unmerged PR dependencies.

PASS: make fmt
PASS: cargo clippy --locked -p agentenv -p overlaybd -p uvm-ublk-daemon --all-targets --all-features -- -D warnings
PASS: cargo test --locked -p overlaybd --lib compression::zfile::tests (12 tests)
PASS: cargo test --locked -p uvm-ublk-daemon --lib (49 tests)
PASS: temporary reproducer fails with the old detector and passes with this fix
PASS: sparse writable upper recognition and truncated-input rejection in the same probe
PASS: git diff --check

Rust checks ran on Linux as a non-root user. The temporary reproducer was removed and is not part of the commit. Full KVM/OSS E2E was not run.

Risks and reviewer notes

The two OverlayBD file patches are preserved from the original commit. Its ublk warning-to-debug hunk is inapplicable because upstream rejects disallowed shrinking instead of warning; that rejection remains intact. Original author guozhengyan maps to guozy18, so no duplicate self-co-author trailer was added.

Checklist

  • One coherent change with no unrelated refactoring or formatting.
  • Original author attribution and author date are retained.
  • No private deployment configuration or credentials included.
  • Generated API files are unchanged.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/420 **Author:** [@guozy18](https://github.com/guozy18) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `sync/zfile-layer-detection` --- ### 📝 Commits (1) - [`75611af`](https://github.com/kvcache-ai/AgentENV/commit/75611af54270afc7df74ca0249d62db79d7c7246) fix(storage): avoid spurious ZFile and disk size warnings ### 📊 Changes **2 files changed** (+31 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `storage/overlaybd/src/compression/zfile.rs` (+9 -5) 📝 `storage/overlaybd/src/layer/layer_metadata.rs` (+22 -9) </details> ### 📄 Description ## What Recognize a valid ZFile header before parsing an OverlayBD LSMT header when deciding whether a layer is a sparse writable upper. ## Why Compressed layers can be smaller than an LSMT header. Reading a full LSMT header first incorrectly rejects those valid layers or emits misleading diagnostics. ## Related issue N/A — focused correction of existing behavior. ## Scope and non-goals The existing ZFile header verifier and the sparse-upper detection helper. ## Design and behavior changes Share the existing ZFile header validation, read at most one LSMT header, and return false for a valid compressed layer. Raw LSMT layers keep their header validation and sparse flag checks; truncated or invalid inputs still fail. ## Compatibility and operations No API, configuration or storage-format changes. Existing compressed layers become readable by the detector. Ordinary code upgrade/revert; no data migration or new host requirements. ## Validation This branch is based directly on upstream main `a97473b` and contains one feature commit with no unmerged PR dependencies. ```text PASS: make fmt PASS: cargo clippy --locked -p agentenv -p overlaybd -p uvm-ublk-daemon --all-targets --all-features -- -D warnings PASS: cargo test --locked -p overlaybd --lib compression::zfile::tests (12 tests) PASS: cargo test --locked -p uvm-ublk-daemon --lib (49 tests) PASS: temporary reproducer fails with the old detector and passes with this fix PASS: sparse writable upper recognition and truncated-input rejection in the same probe PASS: git diff --check ``` Rust checks ran on Linux as a non-root user. The temporary reproducer was removed and is not part of the commit. Full KVM/OSS E2E was not run. ## Risks and reviewer notes The two OverlayBD file patches are preserved from the original commit. Its ublk warning-to-debug hunk is inapplicable because upstream rejects disallowed shrinking instead of warning; that rejection remains intact. Original author guozhengyan maps to guozy18, so no duplicate self-co-author trailer was added. ## Checklist - [x] One coherent change with no unrelated refactoring or formatting. - [x] Original author attribution and author date are retained. - [x] No private deployment configuration or credentials included. - [x] Generated API files are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:23:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#422
No description provided.