Browse Source
fix(filer): check error from FindEntry (#7878)
* fix(filer): check error from FindEntry
* remove
---------
Co-authored-by: Chris Lu <chris.lu@gmail.com>
master
steve.wei
22 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
1 deletions
-
weed/filer/filer.go
|
|
@ -2,6 +2,7 @@ package filer |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"context" |
|
|
"context" |
|
|
|
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"os" |
|
|
"os" |
|
|
"sort" |
|
|
"sort" |
|
|
@ -262,7 +263,10 @@ func (f *Filer) ensureParentDirectoryEntry(ctx context.Context, entry *Entry, di |
|
|
|
|
|
|
|
|
// check the store directly
|
|
|
// check the store directly
|
|
|
glog.V(4).InfofCtx(ctx, "find uncached directory: %s", dirPath) |
|
|
glog.V(4).InfofCtx(ctx, "find uncached directory: %s", dirPath) |
|
|
dirEntry, _ := f.FindEntry(ctx, util.FullPath(dirPath)) |
|
|
|
|
|
|
|
|
dirEntry, findErr := f.FindEntry(ctx, util.FullPath(dirPath)) |
|
|
|
|
|
if findErr != nil && !errors.Is(findErr, filer_pb.ErrNotFound) { |
|
|
|
|
|
return findErr |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// no such existing directory
|
|
|
// no such existing directory
|
|
|
if dirEntry == nil { |
|
|
if dirEntry == nil { |
|
|
|