diff options
| author | Patrick Schmidt <patrick.schmidt@innogames.com> | 2021-06-02 19:30:55 +0200 |
|---|---|---|
| committer | Patrick Schmidt <patrick.schmidt@innogames.com> | 2021-06-02 21:28:02 +0200 |
| commit | 77100754e60752915af008070e3a951e08a67890 (patch) | |
| tree | d6331c66484209ba516a51bf342b8139b58330bd /weed/filesys/xattr.go | |
| parent | cc34475012650bab1d38a248ccdd4cd92a00611f (diff) | |
| download | seaweedfs-77100754e60752915af008070e3a951e08a67890.tar.xz seaweedfs-77100754e60752915af008070e3a951e08a67890.zip | |
Return artificial . and .. directories
Diffstat (limited to 'weed/filesys/xattr.go')
| -rw-r--r-- | weed/filesys/xattr.go | 15 |
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) |
