fix empty hard link id

This commit is contained in:
Chris Lu 2020-09-24 11:16:43 -07:00
parent 1012df7bb5
commit 0790c6d605

View file

@ -24,7 +24,7 @@ func (fsw *FilerStoreWrapper) handleUpdateToHardLinks(ctx context.Context, entry
}
// remove old hard link
if err == nil && bytes.Compare(existingEntry.HardLinkId, entry.HardLinkId) != 0 {
if err == nil && len(existingEntry.HardLinkId) != 0 && bytes.Compare(existingEntry.HardLinkId, entry.HardLinkId) != 0 {
if err = fsw.DeleteHardLink(ctx, existingEntry.HardLinkId); err != nil {
return err
}