From 9aec2f46fe775e1e885df32ed77bdef125aa5391 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 20 Aug 2025 02:55:45 +0900 Subject: container/initdev: check path equivalence by value Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra --- container/initdev.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'container/initdev.go') diff --git a/container/initdev.go b/container/initdev.go index 827df9e9..c06cf224 100644 --- a/container/initdev.go +++ b/container/initdev.go @@ -126,8 +126,14 @@ func (d *MountDevOp) apply(state *setupState) error { fmt.Sprintf("cannot remount %q:", target)) } -func (d *MountDevOp) Is(op Op) bool { vd, ok := op.(*MountDevOp); return ok && *d == *vd } -func (*MountDevOp) prefix() string { return "mounting" } +func (d *MountDevOp) Is(op Op) bool { + vd, ok := op.(*MountDevOp) + return ok && ((d == nil && vd == nil) || (d != nil && vd != nil && + d.Target != nil && vd.Target != nil && + d.Target.String() == vd.Target.String() && + d.Mqueue == vd.Mqueue && d.Write == vd.Write)) +} +func (*MountDevOp) prefix() string { return "mounting" } func (d *MountDevOp) String() string { if d.Mqueue { return fmt.Sprintf("dev on %q with mqueue", d.Target) -- cgit v1.3.1