A failed identity attach leaves the system stick half attached #179

Open
opened 2026-11-11 21:33:54 +00:00 by rajames · 1 comment
Owner

Found

kernel/src/v4/sk_v4_identity.c: sk_v4_drive_arrived attaches Artemis and sets g_stick_in = 1 (~line 388) before the identity partition's blk_subsys_attach_device (line 398). If that fails it returns with Artemis attached, no identity, d->used unset; the message names xhci, not the partition. A later pull detaches Artemis (art_used), so it recovers.

Done when

  • Either both partitions are attached or neither is, with a message naming the identity partition

🤖 Filed with Claude Code -- the code review of 2026-11-11, at 4d42d25c (Captain Bob, 2026-11-11: "File the review findings as issues"). Read, not run: each is to be confirmed by a test written first and seen to fail.

### Found `kernel/src/v4/sk_v4_identity.c`: `sk_v4_drive_arrived` attaches Artemis and sets `g_stick_in = 1` (~line 388) before the identity partition's `blk_subsys_attach_device` (line 398). If that fails it returns with Artemis attached, no identity, `d->used` unset; the message names xhci, not the partition. A later pull detaches Artemis (`art_used`), so it recovers. ### Done when - [ ] Either both partitions are attached or neither is, with a message naming the identity partition 🤖 Filed with [Claude Code](https://claude.com/claude-code) -- the code review of 2026-11-11, at `4d42d25c` (Captain Bob, 2026-11-11: "File the review findings as issues"). Read, not run: each is to be confirmed by a test written first and seen to fail.
rajames added the
kind
bug
area/kernel
priority
nice
status
backlog
labels 2026-11-11 21:33:54 +00:00
rajames added this to the v4.0.0-alpha.5: SDK milestone 2026-11-12 11:43:36 +00:00
Author
Owner

Parked (Captain Bob, 2026-11-12: "park 179").

Writing its test (qemu_session.py ident_attach_fail: the identity partition's first sector unreadable) showed the failure this issue is about cannot be provoked: blk_subsys_attach_device() on the identity partition only fails on out-of-memory or a failing blkio_info(), because blk_format_or_load_disk() takes an unreadable header as blank and attaches anyway -- filed as #187. So the half-attached state is unreachable from a disk fault today, and a test written first needs fault injection in the code itself (a host test harness for kernel code -- not ruled). The test mode is kept in the tree (it fails today, on #187's behaviour).

🤖 Claude Code

**Parked** (Captain Bob, 2026-11-12: "park 179"). Writing its test (`qemu_session.py ident_attach_fail`: the identity partition's first sector unreadable) showed the failure this issue is about cannot be provoked: `blk_subsys_attach_device()` on the identity partition only fails on out-of-memory or a failing `blkio_info()`, because `blk_format_or_load_disk()` takes an unreadable header as blank and attaches anyway -- filed as **#187**. So the half-attached state is unreachable from a disk fault today, and a test written first needs fault injection in the code itself (a host test harness for kernel code -- not ruled). The test mode is kept in the tree (it fails today, on #187's behaviour). 🤖 Claude Code
rajames added
status
blocked
and removed
status
backlog
labels 2026-11-12 16:14:55 +00:00
Sign in to join this conversation.