mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Increment link count in CreateHardlink
Closes #28 PiperOrigin-RevId: 196041391 Change-Id: I5d79f1735b9d72744e8bebc6897002b27df9aa7a
This commit is contained in:
committed by
Shentubot
parent
1bdec86bae
commit
4453b56bd9
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user