aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/xattr.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2021-06-02 12:54:44 -0700
committerGitHub <noreply@github.com>2021-06-02 12:54:44 -0700
commit0a5388744c6603921319ad54e905ebe381a3ba69 (patch)
tree2e4db5cbd91f677192bea5f458ccf42c1eb1746c /weed/filesys/xattr.go
parent62142ff1d2fd3646f4858c51b904fd6aaf3b3b30 (diff)
parent77100754e60752915af008070e3a951e08a67890 (diff)
downloadseaweedfs-0a5388744c6603921319ad54e905ebe381a3ba69.tar.xz
seaweedfs-0a5388744c6603921319ad54e905ebe381a3ba69.zip
Merge pull request #2105 from Woellchen/current_and_parent_dot_directories
Return artificial . and .. directories
Diffstat (limited to 'weed/filesys/xattr.go')
-rw-r--r--weed/filesys/xattr.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/weed/filesys/xattr.go b/weed/filesys/xattr.go
index 92e43b675..473805116 100644
--- a/weed/filesys/xattr.go
+++ b/weed/filesys/xattr.go
@@ -113,6 +113,21 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err
fullpath := util.NewFullPath(dir, name)
// glog.V(3).Infof("read entry cache miss %s", fullpath)
+ // return a valid entry for the mount root
+ if string(fullpath) == wfs.option.FilerMountRootPath {
+ return &filer_pb.Entry{
+ Name: wfs.option.FilerMountRootPath,
+ IsDirectory: true,
+ Attributes: &filer_pb.FuseAttributes{
+ Mtime: wfs.option.MountMtime.Unix(),
+ FileMode: uint32(wfs.option.MountMode),
+ Uid: wfs.option.MountUid,
+ Gid: wfs.option.MountGid,
+ Crtime: wfs.option.MountCtime.Unix(),
+ },
+ }, nil
+ }
+
// read from async meta cache
meta_cache.EnsureVisited(wfs.metaCache, wfs, util.FullPath(dir))
cachedEntry, cacheErr := wfs.metaCache.FindEntry(context.Background(), fullpath)