mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
Use MNT_DETACH for SHM unmount instead of retry loop
After checkpoint the SHM tmpfs can briefly return EBUSY while the kernel releases mount propagation references. Use lazy unmount instead of retrying, as suggested by review. Fixes flake: `podman checkpoint/restore ip and mac handling` Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
parent
81fceb48d2
commit
ee986cd7c9
1 changed files with 5 additions and 5 deletions
|
|
@ -45,12 +45,12 @@ func (c *Container) mountSHM(shmOptions string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Container) unmountSHM(mount string) error {
|
func (c *Container) unmountSHM(mount string) error {
|
||||||
if err := unix.Unmount(mount, 0); err != nil {
|
if err := unix.Unmount(mount, unix.MNT_DETACH); err != nil {
|
||||||
if err != syscall.EINVAL && err != syscall.ENOENT {
|
if err == syscall.EINVAL || err == syscall.ENOENT {
|
||||||
return fmt.Errorf("unmounting container %s SHM mount %s: %w", c.ID(), mount, err)
|
logrus.Debugf("Container %s failed to unmount %s : %v", c.ID(), mount, err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
// If it's just an EINVAL or ENOENT, debug logs only
|
return fmt.Errorf("unmounting container %s SHM mount %s: %w", c.ID(), mount, err)
|
||||||
logrus.Debugf("Container %s failed to unmount %s : %v", c.ID(), mount, err)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue