← Back to Pull requests

erofs: spill xattrs to shared area when exceeding inode stride #139

Closed
unknown closed this pull request without merging on Oct 02, 2026 22:02 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 21:46 UTC
Author

Follow-up to #94 / #113. Prerequisite for #108 and #129.

Fixes #137

Summary of Changes

1. Shared Xattr Spilling & Deduplication in WriteImage:
- Evaluates each inode's inline xattr footprint against the 8-slot stride limit (DefaultInodeStride * SlotSize).
- Keeps attributes inline when they fit within the stride.
- Spills larger attributes to the EROFS shared xattr table (largest first) when stride limits would be exceeded, referencing them with a 4-byte xattr_id.
- Deduplicates identical shared xattr entries across all inodes in the shared xattr block area.
- Sets Superblock.XattrBlkaddr and writes shared xattr table blocks.

2. Reader & Fsck Support:
- Implements shared xattr lookup in ReadXattrs and GetXattrs.
- Validates XattrBlkaddr and verifies xattr integrity during Fsck.

3. Per-Inode Budget & Error Context:
- Enforces the per-inode maximum reference capacity (up to 45 shared xattrs for extended inodes in 8 slots).
- If an inode's attributes cannot fit even when shared, WriteImage rejects it with an error explicitly detailing the path, inode ID, attribute count, and capacity.

4. Testing:
- Added TestErofsXattrSpillingTable covering all rows from the issue description table.
- Added TestErofsXattr16KiBValue verifying 16 KiB xattr values round-trip through snapshots.
- Added TestErofsSharedXattrDeduplication verifying multi-inode deduplication in the shared area.
- Added TestErofsRootRegistryMultiKilobyteXattr verifying multi-kilobyte registry xattrs on the root inode.
- Added TestErofsPerInodeBudgetEnforcement testing upfront budget rejection.
- Validated against external fsck.erofs utility when available.

Diff: 217 lines (+162 / -55) across 2 files Reviewer: justinsb Review duration: 16m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 217 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.322
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #139"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.7% (MEDIUM) · Higher = larger blast radius
36.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.5% · Safe to merge
14.5%