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