summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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
}