Skip to content

Commit

Permalink
Additional potential race condition on os.Readdir
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Aug 12, 2024
1 parent 4f2d98f commit 25d66d9
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 25d66d9

Please sign in to comment.