StreamPathsLexicographically applies the glob only at emit time but recurses into every subdirectory unconditionally. There's no prefix prune, so a non-recursive pattern like dir/* still readDirs every directory beneath dir, then discards the deep entries because * doesn't cross /.
Concretely, beegfs remote push /mnt/beegfs/* correctly uploads only the mount root's direct children, but to do so it stats/reads every directory in the whole mount.
Impact: wasted I/O on large mounts for RST push/pull globs. Correctness is fine. The index path is unaffected (it uses GlobMatchDirs → doublestar.GlobWalk, which prunes).
Suggested fix: before recursing at walk.go:263, skip a subdirectory when the pattern can't match anything beneath it — e.g. when the pattern contains no ** and the candidate's depth already exceeds the pattern's segment count. (Patterns containing ** must still recurse fully.)
StreamPathsLexicographically applies the glob only at emit time but recurses into every subdirectory unconditionally. There's no prefix prune, so a non-recursive pattern like dir/* still readDirs every directory beneath dir, then discards the deep entries because * doesn't cross /.
Concretely,
beegfs remote push /mnt/beegfs/*correctly uploads only the mount root's direct children, but to do so it stats/reads every directory in the whole mount.Impact: wasted I/O on large mounts for RST push/pull globs. Correctness is fine. The index path is unaffected (it uses GlobMatchDirs → doublestar.GlobWalk, which prunes).
Suggested fix: before recursing at walk.go:263, skip a subdirectory when the pattern can't match anything beneath it — e.g. when the pattern contains no ** and the candidate's depth already exceeds the pattern's segment count. (Patterns containing ** must still recurse fully.)