The lock directory and its parent are chmod'ed only when this call's own
Mkdir created them, so an existing or concurrently created directory keeps
its mode; an existing lock path that is not a directory refuses (Lstat), as
the constructor did before. The invariant row links the mode tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new helper treats any existing lock path as the directory; the old
constructor refused a non-directory. Controls: an existing parent and an
existing lock directory keep their modes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing /run/sw-block is created 0755 and the locks directory 0700, with
the modes set explicitly (the umask cannot narrow them); existing
directories are left alone. The cure line also names the parent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1-SPEC r2.45 (1): MkdirAll(locks, 0700) also makes a missing parent
/run/sw-block 0700; created by root, it keeps the unit's user out even after
the locks directory is chowned. The tmpfiles.d layout is parent 0755,
locks 0700.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A test runner that is itself a systemd service (the CI runner unit) passes
its INVOCATION_ID to every child, and blockvolume rightly refuses
--volume-lock-dir-test-only under systemd. Every subprocess start that
passes the flag now builds the child's environment without INVOCATION_ID
(one helper per test package). The product rule is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The rolled-back copy makes no HEAD CAS attempt (counted at the remote,
not inferred from PUTs).
- Control: an exact copy passes the preliminary HEAD read; HEAD then
advances at the same epoch and holder before the claim's own read; the
claim-image recheck refuses it as stale, with no CAS.
- The refused second provider leaves its storage root empty.
- The --help capture registers stderr restoration and pipe closes first,
closes the writer before joining the reader, and bounds the join.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The lock directory is created (0700) when missing; only a directory or
lock file that cannot be created or opened refuses, with the cure
(install the tmpfiles.d entry, or chown the directory and its lock files
to the unit's user).
- The lock file is opened read-only (an existing file first, created 0644
only when missing), so a lock file another user created stays lockable;
it is never unlinked, and the next owner locks the same file.
- A stale-root startup end carries its cure into the final exit line:
exiting status=78 reason=superseded cure="...".
- Tests: a cut's remote_lsn is locally durable at its HEAD CAS, and the
root's crash image at the CAS reattaches and serves; the rolled-back copy
makes no claim or PUT, admits no I/O, keeps its data and durable LSN; an
exact copy at HEAD attaches; a read-only lock file is taken.
- Invariants: INV-WS-ONE-PROCESS-PER-HOST-001 and its M4 edge; the
rollback row names its test file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1-SPEC r2.45.
(1) The provider takes an exclusive, non-blocking lock on
/run/sw-block/locks/<volume id>.lock before the volume's store opens and
releases it after the store closes (HostVolumeLock, set by blockvolume). A
missing directory refuses the provider with the cure; the tmpfiles.d
entry ships in deploy/systemd and both units may write it under
ProtectSystem=strict. --volume-lock-dir-test-only (hidden, refused under
systemd, warned at start) is for plain subprocess tests and harnesses.
(2) An existing root whose HEAD names this holder attaches only if its
local durable LSN reaches HEAD's remote_lsn; otherwise the existing
stale-root refusal, no retry (78 superseded), with the cure.
(3) docs/releases/one-process-per-volume.md: the lifecycle do-not list.
No HEAD change, no format bump, no new persisted file, no new exit reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A second provider for the same volume on one host (another storage root,
the same host lock directory) must be refused before its store opens; a
missing lock directory, the default one included, refuses the provider;
blockvolume's test-only lock directory is hidden from --help and refused
under systemd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
V1-SPEC r2.45 (2): an existing root whose HEAD names this holder must
reach HEAD's remote_lsn with its local durable LSN. A copy taken before a
later cut attaches today.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>