diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go index cf6b4ba28..53de5bea3 100644 --- a/weed/filer2/filer.go +++ b/weed/filer2/filer.go @@ -104,14 +104,14 @@ func (f *Filer) CreateEntry(entry *Entry) error { } */ - if oldEntry, err := f.FindEntry(entry.FullPath); err == nil { - f.deleteChunks(oldEntry) - } + oldEntry, _ := f.FindEntry(entry.FullPath) if err := f.store.InsertEntry(entry); err != nil { return fmt.Errorf("insert entry %s: %v", entry.FullPath, err) } + f.deleteChunks(oldEntry) + return nil }