Merge pull request #5983 from btw616:fix/issue-5982

PiperOrigin-RevId: 373661350
This commit is contained in:
gVisor bot
2021-05-13 14:50:03 -07:00
+4
View File
@@ -1247,6 +1247,7 @@ func (l *localFile) MultiGetAttr(names []string) ([]p9.FullStat, error) {
if parent != l.file.FD() {
// Parent is no longer needed.
_ = unix.Close(parent)
parent = -1
}
if err != nil {
if errors.Is(err, unix.ENOENT) {
@@ -1275,5 +1276,8 @@ func (l *localFile) MultiGetAttr(names []string) ([]p9.FullStat, error) {
}
parent = child
}
if parent != -1 && parent != l.file.FD() {
_ = unix.Close(parent)
}
return stats, nil
}