Fix UDF trimming for BD-R dumps - #437
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughUDF volume-size detection now validates primary AVDPs, tracks reserve VDS metadata, and calculates the final sector count through a new tested module. CMake includes the module and its GoogleTest target. ChangesUDF volume sizing
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change completes UDF filesystem trimming for affected BD-R images, including required reserve metadata and trailing descriptors; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant DVDDump
participant FilesystemContext
participant UDFSize
DVDDump->>FilesystemContext: validate primary AVDP at current LBA
DVDDump->>FilesystemContext: retain and queue VDS extents
DVDDump->>UDFSize: pass partition end and reserve VDS metadata
UDFSize-->>DVDDump: return optional volume sector count
DVDDump->>FilesystemContext: record size and clear UDF mode
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Root cause
The existing trimming path used the partition end plus one sector. On affected BD-R media, the reserve VDS starts at the partition end and extends for another 16 sectors, followed by the trailing AVDP. Trimming at the partition boundary therefore produced a structurally incomplete image.
UDF parsing was also gated on recognizing
NSR02orNSR03in the volume-recognition sequence. A valid primary AVDP is sufficient to identify and process the UDF layout, so this change restores that fallback.Impact
Profile-mismatched BD-R media can now be trimmed to the complete recorded UDF filesystem instead of either stopping at the partition boundary or reading the remaining recordable-media capacity.
Validation
03fd28435283760b72c644cb56cb21a3df5c6acd3225512d4f07a14cc08bd3b31aaaee4f42a8ec9aThe physical-disc output matches Redump #93203.
Fixes #398
Summary by CodeRabbit
Bug Fixes
Tests