aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-15 22:42:24 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-15 22:42:24 -0700
commit3074e9b42850635b28f1ef90fc51e712210d5d45 (patch)
tree02abf2800977b75f74bfecbbb9a418bfd0e6ef60
parentb971317a167ac806a02947047c65ba6c2a2a7bad (diff)
downloadseaweedfs-3074e9b42850635b28f1ef90fc51e712210d5d45.tar.xz
seaweedfs-3074e9b42850635b28f1ef90fc51e712210d5d45.zip
ensure consistent inode value
-rw-r--r--weed/filesys/dir.go6
-rw-r--r--weed/filesys/file.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go
index e74c5aaac..f177c940b 100644
--- a/weed/filesys/dir.go
+++ b/weed/filesys/dir.go
@@ -59,7 +59,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error {
return err
}
- // attr.Inode = util.FullPath(dir.FullPath()).AsInode()
+ attr.Inode = util.FullPath(dir.FullPath()).AsInode()
attr.Mode = os.FileMode(entry.Attributes.FileMode) | os.ModeDir
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
@@ -331,10 +331,10 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) {
processEachEntryFn := func(entry *filer.Entry, isLast bool) {
if entry.IsDirectory() {
- dirent := fuse.Dirent{Name: entry.Name(), Type: fuse.DT_Dir}
+ dirent := fuse.Dirent{Name: entry.Name(), Type: fuse.DT_Dir, Inode: dirPath.Child(entry.Name()).AsInode()}
ret = append(ret, dirent)
} else {
- dirent := fuse.Dirent{Name: entry.Name(), Type: findFileType(uint16(entry.Attr.Mode))}
+ dirent := fuse.Dirent{Name: entry.Name(), Type: findFileType(uint16(entry.Attr.Mode)), Inode: dirPath.Child(entry.Name()).AsInode()}
ret = append(ret, dirent)
}
}
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index a6bc734f3..00a5ac279 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -55,7 +55,7 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) {
return fuse.ENOENT
}
- // attr.Inode = file.fullpath().AsInode()
+ attr.Inode = file.fullpath().AsInode()
attr.Valid = time.Second
attr.Mode = os.FileMode(entry.Attributes.FileMode)
attr.Size = filer.FileSize(entry)