From 9beb3a97201dda48f957c1959981522a0931418c Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 7 Oct 2023 23:41:43 +0200 Subject: [PATCH 1/2] vendor: update c/storage Signed-off-by: Giuseppe Scrivano --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/containers/storage/store.go | 2 +- vendor/modules.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 2e4cae6ffa..f535230a5f 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/containers/libhvee v0.4.1-0.20231005205143-fcf1cc2543b3 github.com/containers/ocicrypt v1.1.8 github.com/containers/psgo v1.8.0 - github.com/containers/storage v1.50.3-0.20231005112617-44418abb2d89 + github.com/containers/storage v1.50.3-0.20231005200628-e21971a94abb github.com/coreos/go-systemd/v22 v22.5.0 github.com/coreos/stream-metadata-go v0.4.3 github.com/crc-org/vfkit v0.1.2-0.20230829083117-09e62065eb6e diff --git a/go.sum b/go.sum index 608f429843..ca0fbb221c 100644 --- a/go.sum +++ b/go.sum @@ -271,8 +271,8 @@ github.com/containers/ocicrypt v1.1.8/go.mod h1:jM362hyBtbwLMWzXQZTlkjKGAQf/BN/L github.com/containers/psgo v1.8.0 h1:2loGekmGAxM9ir5OsXWEfGwFxorMPYnc6gEDsGFQvhY= github.com/containers/psgo v1.8.0/go.mod h1:T8ZxnX3Ur4RvnhxFJ7t8xJ1F48RhiZB4rSrOaR/qGHc= github.com/containers/storage v1.43.0/go.mod h1:uZ147thiIFGdVTjMmIw19knttQnUCl3y9zjreHrg11s= -github.com/containers/storage v1.50.3-0.20231005112617-44418abb2d89 h1:IAFsJzjIalzJCqE6786P9K1qbrYBd1abeL8/ip/waNA= -github.com/containers/storage v1.50.3-0.20231005112617-44418abb2d89/go.mod h1:HZESuTLIRmcs00JFSZr6daHD/B51J0ZCZr0T7uDDc9Y= +github.com/containers/storage v1.50.3-0.20231005200628-e21971a94abb h1:fYLIShJAebUb9l2643IoD9jrj1WEyhux/4/V+2D2CXM= +github.com/containers/storage v1.50.3-0.20231005200628-e21971a94abb/go.mod h1:RepNBJN07JUzkeLwmAeRwUstBqisvf8UoW/E6TR1Pak= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= diff --git a/vendor/github.com/containers/storage/store.go b/vendor/github.com/containers/storage/store.go index eaa420b2bf..6753b296ff 100644 --- a/vendor/github.com/containers/storage/store.go +++ b/vendor/github.com/containers/storage/store.go @@ -3411,7 +3411,7 @@ func (s *store) Shutdown(force bool) ([]string, error) { // so that we reload after a .Shutdown() the same way other processes would. // Shutdown() is basically an error path, so reliability is more important than performance. if _, err2 := s.graphLock.RecordWrite(); err2 != nil { - err = fmt.Errorf("(graphLock.RecordWrite failed: %w", err2) + err = fmt.Errorf("graphLock.RecordWrite failed: %w", err2) } // Do the Cleanup() only after we are sure that the change was recorded with RecordWrite(), so that // the next user picks it. diff --git a/vendor/modules.txt b/vendor/modules.txt index 87cec2c6d3..370b7a9d8b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -339,7 +339,7 @@ github.com/containers/psgo/internal/dev github.com/containers/psgo/internal/host github.com/containers/psgo/internal/proc github.com/containers/psgo/internal/process -# github.com/containers/storage v1.50.3-0.20231005112617-44418abb2d89 +# github.com/containers/storage v1.50.3-0.20231005200628-e21971a94abb ## explicit; go 1.19 github.com/containers/storage github.com/containers/storage/drivers From 8ac2aa79382e6852657e633642530265d3a4d952 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 7 Oct 2023 23:38:12 +0200 Subject: [PATCH 2/2] container: always check if mountpoint is mounted when running as a service, the c.state.Mounted flag could get out of sync if the container is cleaned up through the cleanup process. To avoid this, always check if the mountpoint is really present before skipping the mount. [NO NEW TESTS NEEDED] Closes: https://github.com/containers/podman/issues/17042 Signed-off-by: Giuseppe Scrivano --- libpod/container_internal.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 4098296b5f..6e8306a240 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1539,7 +1539,13 @@ func (c *Container) mountStorage() (_ string, deferredErr error) { var err error // Container already mounted, nothing to do if c.state.Mounted { - return c.state.Mountpoint, nil + mounted := true + if c.ensureState(define.ContainerStateExited) { + mounted, _ = mount.Mounted(c.state.Mountpoint) + } + if mounted { + return c.state.Mountpoint, nil + } } if !c.config.NoShm {