diff options
| author | chrislu <chris.lu@gmail.com> | 2022-07-28 16:32:00 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-07-28 16:32:00 -0700 |
| commit | e0eda52c5418f53fda895741a1878e66d8dffb44 (patch) | |
| tree | c9d8086f1e0e569e2617d3666ed5e22aa4d7dd33 /weed/mount/weedfs.go | |
| parent | ca836568ac3df79373225bf6b98334e641194cfc (diff) | |
| download | seaweedfs-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.go | 6 |
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 } |
