diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-24 02:59:00 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-24 02:59:00 -0800 |
| commit | b05962b90e8491794ce25a74ba01b56b9a34c1a9 (patch) | |
| tree | 7da72f0d00898ca116a6689f7457841b98a9d46a | |
| parent | e31ec04f4f12ae5ce5b7d728343550adb191c56a (diff) | |
| download | seaweedfs-b05962b90e8491794ce25a74ba01b56b9a34c1a9.tar.xz seaweedfs-b05962b90e8491794ce25a74ba01b56b9a34c1a9.zip | |
rename: handle hard links
| -rw-r--r-- | weed/filer/filerstore_hardlink.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/weed/filer/filerstore_hardlink.go b/weed/filer/filerstore_hardlink.go index 316c76a0c..64f41aaba 100644 --- a/weed/filer/filerstore_hardlink.go +++ b/weed/filer/filerstore_hardlink.go @@ -9,12 +9,16 @@ import ( ) func (fsw *FilerStoreWrapper) handleUpdateToHardLinks(ctx context.Context, entry *Entry) error { - if len(entry.HardLinkId) == 0 { + + if entry.IsDirectory() { return nil } - // handle hard links - if err := fsw.setHardLink(ctx, entry); err != nil { - return fmt.Errorf("setHardLink %d: %v", entry.HardLinkId, err) + + if len(entry.HardLinkId) > 0 { + // handle hard links + if err := fsw.setHardLink(ctx, entry); err != nil { + return fmt.Errorf("setHardLink %d: %v", entry.HardLinkId, err) + } } // check what is existing entry |
