mirror of https://github.com/containers/podman.git
Additional potential race condition on os.Readdir
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
4f2d98f228
commit
25d66d97d2
|
@ -1,7 +1,9 @@
|
||||||
package file
|
package file
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -138,7 +140,9 @@ func (locks *FileLocks) DeallocateAllLocks() error {
|
||||||
p := filepath.Join(locks.lockPath, f.Name())
|
p := filepath.Join(locks.lockPath, f.Name())
|
||||||
err := os.Remove(p)
|
err := os.Remove(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lastErr = err
|
if errors.Is(err, fs.ErrNotExist) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
logrus.Errorf("Deallocating lock %s", p)
|
logrus.Errorf("Deallocating lock %s", p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue