mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
pkg/util: FindDeviceNodes() ignore ENOENT errors
This is racy by design, if you walk a tree and the directory was removed between listing and then opening we get an ENOENT error. Simply ignore that case and do not log it. Fixes #21782 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -37,7 +37,9 @@ func FindDeviceNodes() (map[string]string, error) {
|
||||
nodes := make(map[string]string)
|
||||
err := filepath.WalkDir("/dev", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
logrus.Warnf("Error descending into path %s: %v", path, err)
|
||||
if !errors.Is(err, fs.ErrNotExist) {
|
||||
logrus.Warnf("Error descending into path %s: %v", path, err)
|
||||
}
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user