Avoid inode-loop detection in tfork socket cleanup - #6
Open
shengqi-gensee wants to merge 1 commit into
Open
Conversation
shengqi-gensee
marked this pull request as ready for review
July 29, 2026 01:35
|
The fix itself lgtm. The new test covers the desired cleanup behavior, but not the actual OverlayFS inode-loop regression. A normal tempdir with a nested socket would also have worked with the old |
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
Replace tfork's external GNU
findsocket cleanup with Go's path-basedfilepath.WalkDir.OverlayFS can expose unrelated directories with the same device and inode.
GNU
findinterprets that collision as a filesystem loop, skips the affectedsubtree, and leaves stale Unix sockets behind.
WalkDirfollows directorypaths without following symlinks, removes socket entries, and continues after
individual traversal or removal failures.
Add a regression test covering a nested Unix socket, preservation of regular
files, and non-traversal of a symlink outside the root.
Test plan
go test ./pkg/domain/infra/abi -run '^TestTforkPurgeSockets$' -count=1on the Phase 0 GCE VM with the custom kernel and build dependencies
fork isolation, git merge, discard, and cleanup all passed
findfilesystem-loop warning no longer appearsLocal compilation was not used because the development host lacks the GPGME
and Btrfs development headers required by this Podman package.