Commit 72b32d5
fix(lvm): in-line --config filter on every LVM invocation (upstream parity)
Adds a defensive `--config "devices { filter=['r|^/dev/drbd|','r|^/dev/zd|'] }"`
to every shell-out to `lvs` / `pvs` / `vgs` / `lvcreate` /
`lvextend` / `lvremove` in `pkg/storage/lvm/` and the discovery
loop's `pkg/satellite/signatures.go.HasLVMSignature`.
Mirrors upstream LINSTOR's LinstorVlmLayer.java defensive filter —
rejects:
- `/dev/drbdN` paths so LVM doesn't loop on its own LVs that
are exposed back to the host via DRBD (would let LVM see the
same VG twice and surface duplicate-VG warnings at best,
corrupt metadata at worst);
- ZFS zvol paths so a mixed-pool host doesn't accidentally
let LVM scan ZFS-managed block devices.
The new `lvm.ConfigFilter` constant + `lvm.Args(extra...)` helper
centralise the filter — every LVM invocation now goes through
`lvm.Args(...)`. The PLAN's Phase 8.2 entry is updated with a
"new LVM call sites MUST use lvm.Args" rule so future code keeps
the contract.
Pinned indirectly via the existing storage test suite — every
test that asserts an exact `lvX ...` command line was updated to
include the filter prefix; wrap-substring assertions left alone
since the wrap text doesn't repeat the filter.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>1 parent 9fcd368 commit 72b32d5
13 files changed
Lines changed: 199 additions & 166 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| 410 | + | |
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
0 commit comments