mirror of
https://github.com/containers/podman.git
synced 2025-10-19 20:23:08 +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)
|
nodes := make(map[string]string)
|
||||||
err := filepath.WalkDir("/dev", func(path string, d fs.DirEntry, err error) error {
|
err := filepath.WalkDir("/dev", func(path string, d fs.DirEntry, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !errors.Is(err, fs.ErrNotExist) {
|
||||||
logrus.Warnf("Error descending into path %s: %v", path, err)
|
logrus.Warnf("Error descending into path %s: %v", path, err)
|
||||||
|
}
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user