Skip to content

Commit

Permalink
Merge pull request #23587 from rhatdan/errors
Browse files Browse the repository at this point in the history
Additional potential race condition on os.Readdir
  • Loading branch information
openshift-merge-bot[bot] authored Aug 13, 2024
2 parents d4ecd57 + 25d66d9 commit 936455d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libpod/lock/file/file_lock.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package file

import (
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 936455d

Please sign in to comment.