This commit is contained in:
Chris Lu 2020-09-24 11:20:12 -07:00
parent 0790c6d605
commit 7726965a47

View File

@ -32,7 +32,7 @@ func (dir *Dir) Link(ctx context.Context, req *fuse.LinkRequest, old fs.Node) (f
}
// update old file to hardlink mode
if oldFile.entry.HardLinkId == nil {
if len(oldFile.entry.HardLinkId) == 0 {
oldFile.entry.HardLinkId = util.RandomBytes(16)
oldFile.entry.HardLinkCounter = 1
}