Repository navigation
fix: child .rsync-filter rules must override parent directory rules - #4006
Merged
Merged
Conversation
Per-directory merge files (`: .rsync-filter`) inherit from parent directories by design. When a child directory's `.rsync-filter` contains rules that conflict with a parent's, the child rules must win under first-match semantics. Upstream stores the merged list with local (child) rules at the head and inherited (parent) rules at the tail (exclude.c:check_filter), traversing head-first. Our implementation pushed child segments to the back of a Vec via `layers[index].push(segment)` and iterated forward, causing parent rules to be evaluated first - the reverse of upstream. Reverse the iteration in `evaluate()` and `excluded_dir_by_non_dir_rule()` so the newest-pushed (child) segment is checked first. Add a unit test covering the child-overrides-parent precedence.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…4006) Per-directory merge files (`: .rsync-filter`) inherit from parent directories by design. When a child directory's `.rsync-filter` contains rules that conflict with a parent's, the child rules must win under first-match semantics. Upstream stores the merged list with local (child) rules at the head and inherited (parent) rules at the tail (exclude.c:check_filter), traversing head-first. Our implementation pushed child segments to the back of a Vec via `layers[index].push(segment)` and iterated forward, causing parent rules to be evaluated first - the reverse of upstream. Reverse the iteration in `evaluate()` and `excluded_dir_by_non_dir_rule()` so the newest-pushed (child) segment is checked first. Add a unit test covering the child-overrides-parent precedence.
6 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Adds a fourth IoUringPolicy variant (SqpollOff) wired to the new --no-io-uring-sqpoll flag. The variant keeps io_uring active for file and socket I/O but suppresses IORING_SETUP_SQPOLL via a process-wide gate that build_ring() and the session-pool ring builder consult. This gives operators a deterministic opt-out for rootless containers and Kubernetes pods that cannot grant CAP_SYS_NICE, instead of relying on the kernel's EPERM fallback path. Adds docs/deployment/kubernetes.md covering Pod manifests for SQPOLL-enabled and SQPOLL-suppressed workloads, daemon-as-Pod deployment, Pod Security Admission profile interactions, and the tradeoff table. Extends docs/deployment/container-io-uring.md (IKV-F.6) with a K8s rootless-opt-out subsection and adds the new flag to docs/deployment/io-uring-feature-matrix.md. Bundles SQP-K8S.1 / .3 / .4 (#4004 / #4006 / #4007). The rootless throughput bench (SQP-K8S.2) requires container access and is deferred to a follow-up PR.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…4006) Per-directory merge files (`: .rsync-filter`) inherit from parent directories by design. When a child directory's `.rsync-filter` contains rules that conflict with a parent's, the child rules must win under first-match semantics. Upstream stores the merged list with local (child) rules at the head and inherited (parent) rules at the tail (exclude.c:check_filter), traversing head-first. Our implementation pushed child segments to the back of a Vec via `layers[index].push(segment)` and iterated forward, causing parent rules to be evaluated first - the reverse of upstream. Reverse the iteration in `evaluate()` and `excluded_dir_by_non_dir_rule()` so the newest-pushed (child) segment is checked first. Add a unit test covering the child-overrides-parent precedence.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…4006) Per-directory merge files (`: .rsync-filter`) inherit from parent directories by design. When a child directory's `.rsync-filter` contains rules that conflict with a parent's, the child rules must win under first-match semantics. Upstream stores the merged list with local (child) rules at the head and inherited (parent) rules at the tail (exclude.c:check_filter), traversing head-first. Our implementation pushed child segments to the back of a Vec via `layers[index].push(segment)` and iterated forward, causing parent rules to be evaluated first - the reverse of upstream. Reverse the iteration in `evaluate()` and `excluded_dir_by_non_dir_rule()` so the newest-pushed (child) segment is checked first. Add a unit test covering the child-overrides-parent precedence.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Adds a fourth IoUringPolicy variant (SqpollOff) wired to the new --no-io-uring-sqpoll flag. The variant keeps io_uring active for file and socket I/O but suppresses IORING_SETUP_SQPOLL via a process-wide gate that build_ring() and the session-pool ring builder consult. This gives operators a deterministic opt-out for rootless containers and Kubernetes pods that cannot grant CAP_SYS_NICE, instead of relying on the kernel's EPERM fallback path. Adds docs/deployment/kubernetes.md covering Pod manifests for SQPOLL-enabled and SQPOLL-suppressed workloads, daemon-as-Pod deployment, Pod Security Admission profile interactions, and the tradeoff table. Extends docs/deployment/container-io-uring.md (IKV-F.6) with a K8s rootless-opt-out subsection and adds the new flag to docs/deployment/io-uring-feature-matrix.md. Bundles SQP-K8S.1 / .3 / .4 (#4004 / #4006 / #4007). The rootless throughput bench (SQP-K8S.2) requires container access and is deferred to a follow-up PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Per-directory merge files (
: .rsync-filter) inherit rules from parent directories. When a child directory's.rsync-filtercontains rules that conflict with a parent's, the child rules must win under first-match semantics. Our implementation was evaluating parent rules first, the reverse of upstream.Upstream behavior
In
exclude.c:check_filter(), the merged rule list stores local (child) rules at the head and inherited (parent) rules at the tail. Traversal is head-first, so child rules are evaluated and matched before parent rules.Our implementation (before this fix)
context_impl/transfer.rspopulateslayers[index]via.push(segment)as we descend into subdirectories. Root segment lands atlayers[0]; current directory atlayers[N-1]. The two evaluation loops infilter_program/program.rsiterated thisVecforward, so parent rules were evaluated and matched first - exactly the opposite of upstream.Fix
Iterate
layers.iter().rev()so the newest-pushed (child) segment runs first. Two call sites:FilterProgram::evaluate()(line 181)FilterProgram::excluded_dir_by_non_dir_rule()(line 222)Closes #2128.
Test plan
child_dir_merge_rules_override_parent_rules: parent excludesdebug.log, child includesdebug.log, child must win.