[BUG] Extended device numbers collapse to zero in inode metadata #16

Closed
opened 2026-09-30 17:26:29 +02:00 by erikinkinen · 0 comments
Owner

Summary

E2fsd's represented-device decoder always reads the first inode block word. Extended character/block device encodings select the second word by leaving the first zero, so their metadata is incorrectly reported as device 0:0. Both retained native metadata and the older stat surface share this decoder.

Reproduction

At E2fsd 782f08cd21daca0b3a0dee561936de1c803fa3df, inspect inode_device_number in src/media/metadata.rs. Its input is always bytes 0 through 3 of the retained inode's block area. An original character/block inode with first word zero and second word 0xdefabc12 represents major 0xabc, minor 0xdef12, but the existing function passes zero to its decoder.

Independently authored literal ext-inode controls cover this input, zero, the extended maxima and legacy precedence. The actual image/native witness adds extended device nodes. These controls have not run: tests, builds, lint checks, VM/profiler execution and CI observation remain deferred by user instruction. No observed command output or runtime reproduction is claimed.

Expected and actual behavior

Expected: a nonzero legacy first word supplies its 8-bit major/minor pair; otherwise the second word supplies the extended 12-bit major and 20-bit minor. Meaningful 0:0 remains zero. Other inode types do not expose data pointers as device numbers.

Actual source: the second word is never inspected, and extended values collapse to zero. The repair selects the original encoding before converting its fields to the native major-high/minor-low 64-bit description.

Environment and identity

  • E2fsd: 782f08cd21daca0b3a0dee561936de1c803fa3df; Integration graph: 30717d25d434143bc8464c8636a6c5a75103b535.
  • Input: original ext character/block inode metadata; no device content endpoint.
  • Image/VM/toolchain: none executed for this source audit.
  • Authority: metadata-only observation through the existing retained mount/inode; no new block, character or clock grant.
  • Last known working revision: not established.

Evidence and prior checks

The direct source selection reads only the first four bytes while advertising the represented-device field as known. The new controls use independent literal media words and explicit expected pairs, preserving original bytes and counting media writes. The native workload will observe actual image records through guarded compatibility status when execution is re-enabled. No external implementation code is copied or translated.

Tracking

Related status and directory work, E2fsd review and phase completion. Close after the decoder repair and coherent signed publication; deferred test execution does not gate source acceptance.

Original represented-device status — 30 September 2026

Existing field offsets are unchanged; earlier wire minors and shorter bodies are refused. Native character/block observations require independent device availability, including meaningful 0:0.

No clock, device, socket, pipe or new provider route is granted; content gates, error ordering, original caller/pin cleanup and alias custody remain unchanged.

The full status/directory feature remains open for complete FAT metadata, pipe/stream status and remaining full-item integration. Both full EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.

Related records and contracts
Repository Links
docs PR 4
e2fsd issue 16
integration PR 12
lib-ipc PR 2
lib-posixabi PR 3
posixd PR 5
rootd PR 2
## Summary E2fsd's represented-device decoder always reads the first inode block word. Extended character/block device encodings select the second word by leaving the first zero, so their metadata is incorrectly reported as device 0:0. Both retained native metadata and the older stat surface share this decoder. ## Reproduction At E2fsd `782f08cd21daca0b3a0dee561936de1c803fa3df`, inspect `inode_device_number` in `src/media/metadata.rs`. Its input is always bytes 0 through 3 of the retained inode's block area. An original character/block inode with first word zero and second word `0xdefabc12` represents major `0xabc`, minor `0xdef12`, but the existing function passes zero to its decoder. Independently authored literal ext-inode controls cover this input, zero, the extended maxima and legacy precedence. The actual image/native witness adds extended device nodes. These controls have not run: tests, builds, lint checks, VM/profiler execution and CI observation remain deferred by user instruction. No observed command output or runtime reproduction is claimed. ## Expected and actual behavior Expected: a nonzero legacy first word supplies its 8-bit major/minor pair; otherwise the second word supplies the extended 12-bit major and 20-bit minor. Meaningful 0:0 remains zero. Other inode types do not expose data pointers as device numbers. Actual source: the second word is never inspected, and extended values collapse to zero. The repair selects the original encoding before converting its fields to the native major-high/minor-low 64-bit description. ## Environment and identity - E2fsd: `782f08cd21daca0b3a0dee561936de1c803fa3df`; Integration graph: `30717d25d434143bc8464c8636a6c5a75103b535`. - Input: original ext character/block inode metadata; no device content endpoint. - Image/VM/toolchain: none executed for this source audit. - Authority: metadata-only observation through the existing retained mount/inode; no new block, character or clock grant. - Last known working revision: not established. ## Evidence and prior checks The direct source selection reads only the first four bytes while advertising the represented-device field as known. The new controls use independent literal media words and explicit expected pairs, preserving original bytes and counting media writes. The native workload will observe actual image records through guarded compatibility status when execution is re-enabled. No external implementation code is copied or translated. ## Tracking Related [status and directory work](https://git.erikinkinen.fi/erix/posixd/issues/25), [E2fsd review](https://git.erikinkinen.fi/erix/e2fsd/pulls/3) and [phase completion](https://git.erikinkinen.fi/erix/integration/issues/65). Close after the decoder repair and coherent signed publication; deferred test execution does not gate source acceptance. ### Original represented-device status — 30 September 2026 Existing field offsets are unchanged; earlier wire minors and shorter bodies are refused. Native character/block observations require independent device availability, including meaningful 0:0. No clock, device, socket, pipe or new provider route is granted; content gates, error ordering, original caller/pin cleanup and alias custody remain unchanged. The [full status/directory feature](https://git.erikinkinen.fi/erix/posixd/issues/25) remains open for complete FAT metadata, pipe/stream status and remaining full-item integration. Both full EriX guest generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed. <details> <summary>Related records and contracts</summary> | Repository | Links | | --- | --- | | docs | [PR 4](https://git.erikinkinen.fi/erix/docs/pulls/4) | | e2fsd | [issue 16](https://git.erikinkinen.fi/erix/e2fsd/issues/16) | | integration | [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12) | | lib-ipc | [PR 2](https://git.erikinkinen.fi/erix/lib-ipc/pulls/2) | | lib-posixabi | [PR 3](https://git.erikinkinen.fi/erix/lib-posixabi/pulls/3) | | posixd | [PR 5](https://git.erikinkinen.fi/erix/posixd/pulls/5) | | rootd | [PR 2](https://git.erikinkinen.fi/erix/rootd/pulls/2) | </details>
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:33:46 +01: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
erix/e2fsd#16
No description provided.