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:
Kubernetes Prow Robot 2019-09-22 00:53:23 -07:00 committed by GitHub
commit 338a09abd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1132,7 +1132,7 @@ func doSafeMakeDir(pathname string, base string, perm os.FileMode) error {
return fmt.Errorf("cannot create directory %s: %s", currentPath, err)
}
// Dive into the created directory
childFD, err := syscall.Openat(parentFD, dir, nofollowFlags, 0)
childFD, err = syscall.Openat(parentFD, dir, nofollowFlags, 0)
if err != nil {
return fmt.Errorf("cannot open %s: %s", currentPath, err)
}