volume-manager: the removal comment says lazy retirement, not an eager sweep
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.
This commit is contained in:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user