aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_dir_read.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-12 22:21:30 -0800
committerchrislu <chris.lu@gmail.com>2022-02-12 22:21:30 -0800
commitb0a5193e326962c8a411f872f45ddb6a16962fd9 (patch)
tree33a390b8e73035f30dc65856843720ce0e2af562 /weed/mount/weedfs_dir_read.go
parent661a34e23da36b58f164bafb935a5d0cfdd8af2a (diff)
downloadseaweedfs-b0a5193e326962c8a411f872f45ddb6a16962fd9.tar.xz
seaweedfs-b0a5193e326962c8a411f872f45ddb6a16962fd9.zip
working
Diffstat (limited to 'weed/mount/weedfs_dir_read.go')
-rw-r--r--weed/mount/weedfs_dir_read.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.go
index a696953a1..bae6a18a2 100644
--- a/weed/mount/weedfs_dir_read.go
+++ b/weed/mount/weedfs_dir_read.go
@@ -14,6 +14,9 @@ import (
// Directory handling
func (wfs *WFS) OpenDir(cancel <-chan struct{}, input *fuse.OpenIn, out *fuse.OpenOut) (code fuse.Status) {
+ if !wfs.inodeToPath.HasInode(input.NodeId) {
+ return fuse.ENOENT
+ }
return fuse.OK
}
func (wfs *WFS) ReleaseDir(input *fuse.ReleaseIn) {
@@ -35,13 +38,16 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
println("input size", input.Size, "offset", input.Offset, "pid", input.Caller.Pid)
+ var counter uint64
var dirEntry fuse.DirEntry
if input.Offset == 0 {
+ counter++
dirEntry.Ino = input.NodeId
dirEntry.Name = "."
dirEntry.Mode = toSystemMode(os.ModeDir)
out.AddDirEntry(dirEntry)
+ counter++
parentDir, _ := dirPath.DirAndName()
parentInode := wfs.inodeToPath.GetInode(util.FullPath(parentDir))
dirEntry.Ino = parentInode
@@ -51,7 +57,6 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
}
- var counter uint64
processEachEntryFn := func(entry *filer.Entry, isLast bool) bool {
counter++
if counter <= input.Offset {