sync: fix cpu spinning when empty directory finding with leading slashes

Before this change the logic which makes sure we create all
directories could get confused with directories which started with
slashes and get into an infinite loop consuming 100% of the CPU.
This commit is contained in:
Nick Craig-Wood 2025-01-11 12:49:40 +00:00
parent 77429b154e
commit c837664653
1 changed files with 1 additions and 1 deletions

View File

@ -726,7 +726,7 @@ func (s *syncCopyMove) markParentNotEmpty(entry fs.DirEntry) {
parentDir = ""
}
delete(s.srcEmptyDirs, parentDir)
if parentDir == "" {
if parentDir == "" || parentDir == "/" {
break
}
parentDir = path.Dir(parentDir)