aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-28 16:32:00 -0700
committerchrislu <chris.lu@gmail.com>2022-07-28 16:32:00 -0700
commite0eda52c5418f53fda895741a1878e66d8dffb44 (patch)
treec9d8086f1e0e569e2617d3666ed5e22aa4d7dd33 /weed/mount/weedfs.go
parentca836568ac3df79373225bf6b98334e641194cfc (diff)
downloadseaweedfs-e0eda52c5418f53fda895741a1878e66d8dffb44.tar.xz
seaweedfs-e0eda52c5418f53fda895741a1878e66d8dffb44.zip
mount: ensure symlink parent directory is tracked
fix https://github.com/chrislusf/seaweedfs/issues/3373
Diffstat (limited to 'weed/mount/weedfs.go')
-rw-r--r--weed/mount/weedfs.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index d7516b6c1..f360594f9 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -144,8 +144,10 @@ func (wfs *WFS) maybeReadEntry(inode uint64, followSymLink bool) (path util.Full
if entry != nil && entry.Attributes != nil && entry.Attributes.Inode != 0 {
targetInode = entry.Attributes.Inode
}
- target := filepath.Join(string(path), "../"+entry.Attributes.SymlinkTarget)
- entry, status = wfs.maybeLoadEntry(util.FullPath(target))
+ target := util.FullPath(filepath.Join(string(path), "../"+entry.Attributes.SymlinkTarget))
+ targetParent, _ := target.DirAndName()
+ wfs.inodeToPath.EnsurePath(util.FullPath(targetParent), true)
+ entry, status = wfs.maybeLoadEntry(target)
}
return
}