aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-04-30 22:51:06 -0700
committerChris Lu <chris.lu@gmail.com>2021-04-30 22:51:06 -0700
commit3a86d4dbfded2fb34f0d9cb696a6c5ba9415be4f (patch)
treec7fecd3f9a514fa1c2b2c70b5ccb64b552f62273 /weed/filesys/wfs.go
parentd74cdf011553ae073d524a080f65f418c76ccaa7 (diff)
downloadseaweedfs-3a86d4dbfded2fb34f0d9cb696a6c5ba9415be4f.tar.xz
seaweedfs-3a86d4dbfded2fb34f0d9cb696a6c5ba9415be4f.zip
mount: fix directory invalidation
fix https://github.com/chrislusf/seaweedfs/issues/2038
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 42816d23d..832925bc1 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -111,6 +111,9 @@ func NewSeaweedFileSystem(option *Option) *WFS {
dir, name := filePath.DirAndName()
parent := NodeWithId(util.FullPath(dir).AsInode())
+ if dir == option.FilerMountRootPath {
+ parent = NodeWithId(1)
+ }
if err := wfs.Server.InvalidateEntry(parent, name); err != nil {
glog.V(4).Infof("InvalidateEntry %s : %v", filePath, err)
}
@@ -121,7 +124,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
wfs.metaCache.Shutdown()
})
- wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}
+ wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs, id: 1}
wfs.fsNodeCache = newFsCache(wfs.root)
if wfs.option.ConcurrentWriters > 0 {