summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/sentry/fs/gofer/path.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/sentry/fs/gofer/path.go b/pkg/sentry/fs/gofer/path.go
index d696f1561..6c4c2eed9 100644
--- a/pkg/sentry/fs/gofer/path.go
+++ b/pkg/sentry/fs/gofer/path.go
@@ -150,8 +150,10 @@ func (i *inodeOperations) CreateHardLink(ctx context.Context, _ *fs.Inode, targe
if err := i.fileState.file.link(ctx, &targetOpts.fileState.file, newName); err != nil {
return err
}
- // TODO: Don't increase link count because we can't properly accounts for links
- // with gofers.
+ if i.session().cachePolicy == cacheAll {
+ // Increase link count.
+ targetOpts.cachingInodeOps.IncLinks(ctx)
+ }
i.touchModificationTime(ctx)
return nil
}