mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #82873 from odinuge/volume-fd-leak-openstack
Fix possible fd leak and closing of dirs in doSafeMakeDir
This commit is contained in:
commit
338a09abd2
@ -1132,7 +1132,7 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error {
|
|||||||
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
|
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
|
||||||
}
|
}
|
||||||
// Dive into the created directory
|
// Dive into the created directory
|
||||||
childFD, err := syscall.Openat(parentFD, dir, nofollowFlags, 0)
|
childFD, err = syscall.Openat(parentFD, dir, nofollowFlags, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("cannot open %s: %s", currentPath, err)
|
return fmt.Errorf("cannot open %s: %s", currentPath, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user