mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 07:47:24 +08:00
fuse mount: avoid lookup nil entry
fix https://github.com/chrislusf/seaweedfs/issues/1221
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
package filesys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/filer2"
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||
@@ -124,9 +121,9 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err
|
||||
Directory: dir,
|
||||
}
|
||||
|
||||
resp, err := client.LookupDirectoryEntry(context.Background(), request)
|
||||
if err != nil || resp == nil || resp.Entry == nil {
|
||||
if err == filer2.ErrNotFound || strings.Contains(err.Error(), filer2.ErrNotFound.Error()) {
|
||||
resp, err := filer_pb.LookupEntry(client, request)
|
||||
if err != nil {
|
||||
if err == filer2.ErrNotFound {
|
||||
glog.V(3).Infof("file attr read not found file %v: %v", request, err)
|
||||
return fuse.ENOENT
|
||||
}
|
||||
|
Reference in New Issue
Block a user