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
fix listing with correct inode
chrislu65a19e3abc60
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.goindex 49ac22574c..40726a6948 100644--- a/weed/mount/weedfs_dir_read.go+++ b/weed/mount/weedfs_dir_read.go@@ -5,10 +5,8 @@ import ("github.com/chrislusf/seaweedfs/weed/filer""github.com/chrislusf/seaweedfs/weed/glog""github.com/chrislusf/seaweedfs/weed/mount/meta_cache"- "github.com/chrislusf/seaweedfs/weed/util""github.com/hanwen/go-fuse/v2/fuse""math"- "os""sync")@@ -147,32 +145,29 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPldirPath := wfs.inodeToPath.GetPath(input.NodeId)var dirEntry fuse.DirEntry- if input.Offset == 0 && !isPlusMode {- dirEntry.Ino = input.NodeId- dirEntry.Name = "."- dirEntry.Mode = toSystemMode(os.ModeDir)- out.AddDirEntry(dirEntry)-- parentDir, _ := dirPath.DirAndName()- parentInode := wfs.inodeToPath.GetInode(util.FullPath(parentDir))- dirEntry.Ino = parentInode- dirEntry.Name = ".."- dirEntry.Mode = toSystemMode(os.ModeDir)- out.AddDirEntry(dirEntry)-+ if input.Offset == 0 {+ if !isPlusMode {+ out.AddDirEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "."})+ out.AddDirEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".."})+ } else {+ out.AddDirLookupEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: "."})+ out.AddDirLookupEntry(fuse.DirEntry{Mode: fuse.S_IFDIR, Name: ".."})+ }}processEachEntryFn := func(entry *filer.Entry, isLast bool) bool {dirEntry.Name = entry.Name()- inode := wfs.inodeToPath.GetInode(dirPath.Child(dirEntry.Name))- dirEntry.Ino = inodedirEntry.Mode = toSystemMode(entry.Mode)if !isPlusMode {+ inode := wfs.inodeToPath.Lookup(dirPath.Child(dirEntry.Name), entry.IsDirectory(), false)+ dirEntry.Ino = inodeif !out.AddDirEntry(dirEntry) {isEarlyTerminated = truereturn false}} else {+ inode := wfs.inodeToPath.Lookup(dirPath.Child(dirEntry.Name), entry.IsDirectory(), true)+ dirEntry.Ino = inodeentryOut := out.AddDirLookupEntry(dirEntry)if entryOut == nil {isEarlyTerminated = true