Skip to content

Commit

Permalink
Merge pull request #23645 from Luap99/mount-race
Browse files Browse the repository at this point in the history
podman mount: fix storage/libpod ctr race
  • Loading branch information
openshift-merge-bot[bot] authored Aug 16, 2024
2 parents 8c132cc + 7a7aec3 commit e8410b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/domain/infra/abi/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,11 @@ func (ic *ContainerEngine) ContainerMount(ctx context.Context, nameOrIDs []strin
for _, sctr := range storageCtrs {
mounted, path, err := ic.Libpod.IsStorageContainerMounted(sctr.ID)
if err != nil {
if errors.Is(err, types.ErrContainerUnknown) {
// ErrCtrExists means this is a libpod container, we handle that below.
// This can only happen in a narrow race because we first create the storage
// container and then the libpod container so the StorageContainers() call
// above would need to happen in that interval.
if errors.Is(err, types.ErrContainerUnknown) || errors.Is(err, define.ErrCtrExists) {
continue
}
return nil, err
Expand Down

0 comments on commit e8410b8

Please sign in to comment.