mount: ensure symlink parent directory is tracked

fix https://github.com/chrislusf/seaweedfs/issues/3373
This commit is contained in:
chrislu
2022-07-28 16:32:00 -07:00
parent ca836568ac
commit e0eda52c54
2 changed files with 19 additions and 2 deletions

View File

@@ -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
}