From 68e65803ebeb18be694b17e189789ca4dc1b4570 Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Sun, 9 Aug 2026 20:56:51 +0100 Subject: [PATCH] volume-manager: the removal comment says lazy retirement, not an eager sweep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The V4 adversarial review found removeVolume's comment overclaiming: it said "the kernel sweeps a dead backend's mounts", which reads as an eager death-time sweep. There is no such sweep. Killing the filesystem marks its backend endpoint dead (killOwnedEndpointsLocked), and the VFS router retires each mount that endpoint backed lazily, on the next path resolution under it (resolvePath sees the dead backend, frees the slot, returns not_found). The functional guarantee the comment promised — killing the filesystem retires its mounts — holds; only the described mechanism was wrong. Comment-only; no behavior change. --- system/services/volume-manager/volume-manager.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system/services/volume-manager/volume-manager.zig b/system/services/volume-manager/volume-manager.zig index c00dbe4..6fe5851 100644 --- a/system/services/volume-manager/volume-manager.zig +++ b/system/services/volume-manager/volume-manager.zig @@ -226,9 +226,12 @@ fn bringUpVolume() void { } /// The storage provider left the device tree (a pulled stick): kill the -/// filesystem so its mounts are retired (the kernel sweeps a dead backend's -/// mounts), drop the now-dead channel, and clear the volume. The next poll that -/// sees storage return will re-mount. +/// filesystem so its mounts are retired. Retirement is lazy, not an eager +/// death-time sweep — killing the process marks the filesystem's backend +/// endpoint dead, and the VFS router drops each mount that endpoint backed on +/// the next path resolution under it (that resolve frees the slot and returns +/// not_found). Then drop the now-dead channel and clear the volume; the next +/// poll that sees storage return re-mounts. fn removeVolume() void { const v = volume orelse return; std.log.info("storage for volume {d} removed; unmounting", .{v.id});