summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-05-13 14:50:03 -0700
committergVisor bot <gvisor-bot@google.com>2021-05-13 14:50:03 -0700
commit3894c9fcb92f36a03020b6dc13f1471b10eec029 (patch)
tree4f845a9095eacfd53c56c8aa953fc8108b688259 /runsc
parentf3478b7516e02ab341324ae1361ea9b019ae4f4e (diff)
parentddaa36bde5c55067ca866dbfcbd2e560e3bb356d (diff)
Merge pull request #5983 from btw616:fix/issue-5982
PiperOrigin-RevId: 373661350
Diffstat (limited to 'runsc')
-rw-r--r--runsc/fsgofer/fsgofer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go
index b81ede5ae..3f362b25e 100644
--- a/runsc/fsgofer/fsgofer.go
+++ b/runsc/fsgofer/fsgofer.go
@@ -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
}