aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/commands.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-07 16:51:46 -0800
committerChris Lu <chris.lu@gmail.com>2020-03-07 16:51:46 -0800
commit8645283a7b8a50485390267be9f83b83707f6161 (patch)
tree9e3e3f212d918e9fa7b0ac90b6ac9d9d687d0b56 /weed/shell/commands.go
parent936e7cdbfb02e719058fa341772f2f8afee2a9f1 (diff)
downloadseaweedfs-8645283a7b8a50485390267be9f83b83707f6161.tar.xz
seaweedfs-8645283a7b8a50485390267be9f83b83707f6161.zip
fuse mount: avoid lookup nil entry
fix https://github.com/chrislusf/seaweedfs/issues/1221
Diffstat (limited to 'weed/shell/commands.go')
-rw-r--r--weed/shell/commands.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 93a4c94bb..2239fa435 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -71,7 +71,7 @@ func (ce *CommandEnv) checkDirectory(filerServer string, filerPort int64, path s
return ce.withFilerClient(filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {
- resp, lookupErr := client.LookupDirectoryEntry(context.Background(), &filer_pb.LookupDirectoryEntryRequest{
+ resp, lookupErr := filer_pb.LookupEntry(client, &filer_pb.LookupDirectoryEntryRequest{
Directory: dir,
Name: name,
})
@@ -79,10 +79,6 @@ func (ce *CommandEnv) checkDirectory(filerServer string, filerPort int64, path s
return lookupErr
}
- if resp.Entry == nil {
- return fmt.Errorf("entry not found")
- }
-
if !resp.Entry.IsDirectory {
return fmt.Errorf("not a directory")
}