Skip to content

Commit bf869e4

Browse files
authored
Merge pull request #215 from cozystack/fix/lvm-loop-filter
fix(cozystack): exclude loop devices from LVM global_filter
2 parents 62f344c + fbc207f commit bf869e4

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎charts/cozystack/templates/_helpers.tpl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ machine:
110110
archive = 0
111111
}
112112
devices {
113-
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|" ]
113+
global_filter = [ "r|^/dev/drbd.*|", "r|^/dev/dm-.*|", "r|^/dev/zd.*|", "r|^/dev/loop.*|" ]
114114
}
115115
{{- with .Values.extraMachineFiles }}
116116
{{- toYaml . | nindent 2 }}

‎pkg/engine/contract_machine_test.go‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,10 @@ func TestContract_Machine_CertSANs_LoopbackUnconditional_Cozystack(t *testing.T)
630630
// plugin paths. Required for SR-IOV / GPU device plugins to
631631
// surface inside privileged containers.
632632
// 2. /etc/lvm/lvm.conf — disables LVM backup/archive and sets a
633-
// global_filter that excludes drbd, dm-, zd- devices. Required so
634-
// LVM does not race the storage stack at boot.
633+
// global_filter that excludes drbd, dm-, zd-, loop devices.
634+
// Required so LVM does not race the storage stack at boot, and
635+
// so the host never activates a volume group living inside a
636+
// loop-mounted image.
635637
//
636638
// Both files use op: create / op: overwrite respectively. A regression
637639
// removing either silently breaks GPU/SRIOV or LVM ordering.
@@ -651,6 +653,7 @@ func TestContract_Machine_Files_Cozystack(t *testing.T) {
651653
assertContains(t, out, `r|^/dev/drbd.*|`)
652654
assertContains(t, out, `r|^/dev/dm-.*|`)
653655
assertContains(t, out, `r|^/dev/zd.*|`)
656+
assertContains(t, out, `r|^/dev/loop.*|`)
654657
})
655658
}
656659
}

0 commit comments

Comments
 (0)