SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
mount2: fix directory pagination
chrislu3cbce878f2c6
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.goindex 99882fcf84..008146773b 100644--- a/weed/mount/weedfs_dir_read.go+++ b/weed/mount/weedfs_dir_read.go@@ -16,7 +16,6 @@ type DirectoryHandleId uint64type DirectoryHandle struct {isFinished bool- counter uint32lastEntryName string}@@ -139,17 +138,16 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPlreturn fuse.OK}+ isEarlyTerminated := falsedirPath := wfs.inodeToPath.GetPath(input.NodeId)var dirEntry fuse.DirEntryif input.Offset == 0 && !isPlusMode {- dh.counter++dirEntry.Ino = input.NodeIddirEntry.Name = "."dirEntry.Mode = toSystemMode(os.ModeDir)out.AddDirEntry(dirEntry)- dh.counter++parentDir, _ := dirPath.DirAndName()parentInode := wfs.inodeToPath.GetInode(util.FullPath(parentDir))dirEntry.Ino = parentInode@@ -160,18 +158,19 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl}processEachEntryFn := func(entry *filer.Entry, isLast bool) bool {- dh.counter++dirEntry.Name = entry.Name()inode := wfs.inodeToPath.GetInode(dirPath.Child(dirEntry.Name))dirEntry.Ino = inodedirEntry.Mode = toSystemMode(entry.Mode)if !isPlusMode {if !out.AddDirEntry(dirEntry) {+ isEarlyTerminated = truereturn false}} else {entryOut := out.AddDirLookupEntry(dirEntry)if entryOut == nil {+ isEarlyTerminated = truereturn false}wfs.outputFilerEntry(entryOut, inode, entry)@@ -191,7 +190,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPlglog.Errorf("list meta cache: %v", listErr)return fuse.EIO}- if dh.counter < input.Length {+ if !isEarlyTerminated {dh.isFinished = true}