Repository navigation
fix: keep ACLs in local batches and INC_RECURSE sub-lists - #8281
Merged
Merged
Conversation
oferchen
force-pushed
the
fix/local-batch-acls
branch
from
November 3, 2026 06:40
e60638d to
aa6d2f8
Compare
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
Two ACL losses, both silent (exit 0):
Local
--write-batch -Acarried only the mode-derived ACL. The engine batch writer never read the source ACL, so named user/group entries and a directory's default ACL were missing from the batch, and upstream 3.5.1 replayed it without them. The writer now reads each entry's ACL as the generator does for a network send (flist.c:2048-2055get_acl(), the--fake-superstash first), hands it to the flist writer before the entry (held alongside the entry under INC_RECURSE), names ACL ids inline under INC_RECURSE (acls.c:827) and adds them to the uid/gid id lists otherwise (acls.c:821-826).An INC_RECURSE receiver dropped the ACL of every file listed in a sub-list. The receiver copied its ACL cache once, after the initial file list (
receiver/transfer/setup/context.rs), so an entry whose ACL first appears in a later sub-list named an index the appliers never saw, and the file kept only what its parent's default ACL gave it. Pulls default to INC_RECURSE, sooc-rsync -rA host:src/ dst/hit it, as did an oc replay of an incremental batch. The shared cache (LiveAclCache, anArc<RwLock<AclCache>>) is now extended after every sub-list with only the ACLs that list added (AclCache::extend_from), matching upstream's single growingaccess_acl_list/default_acl_list(acls.c:94-95,acls.c:1016-1024). No per-sub-list clone of the whole cache; memory is the same one copy as before.Tests
tests/batch_upstream_oracle.rslocal_batch_carries_named_acl_entries_like_upstream: records with oc and 3.5.1 under INC_RECURSE,--no-inc-recursiveand--protocol=29, replays each batch with both, and comparesgetfaclof every path with the source. It also checks each batch names the ACL's user (inline or in the id lists).tests/inc_recurse_receiver_acls.rsinc_recurse_receiver_applies_sub_list_acls: oc and 3.5.1 as client and server, pull and push, with and without--inc-recursive, over a remote-shell wrapper; the fixture has a default ACL on a sub-list directory and a different ACL on a file inside it. The oc-to-oc cells run without an upstream binary.AclCache::extend_fromunit test.The receiver test was committed failing before the fix (cell
client=oc server=oc push=false --inc-recursive:sub/b.logshowed the inheriteduser:nobody:r-x/group:nobody:rwxentries instead of its owngroup:nobody:r--).Gates: fmt; Linux and windows-gnu workspace clippy; nextest protocol 6172, engine 4918, batch 227, transfer 3294, metadata 723, core 2941, cli 3896, daemon 2147, all passed; acl/batch/inc integration tests 78/78; interop oracle 664 cells, PASS=638, XFAIL=26, FAIL=0.
Mutations (all killed)
extend_fromcopies nothingset_pending_aclset_pending_aclNot covered
IOERR_GENERALwhenget_acl()fails (flist.c:2052-2055); the batch writer, like the generator, falls back to the mode-derived ACL. Unchanged here.