This repository was archived by the owner on Oct 3, 2026. It is now read-only.
Repository navigation
Conversation
checkNoLoopDevice did a single immediate FindByBackingFile check after the temp mount cleanup returned. The kernel releases loop devices asynchronously after LOOP_CLR_FD / autoclear, so the backing file can still resolve to a device for a short window, causing flaky failures: loop device /dev/loop1 still attached to .../layer.erofs (seen in TestWithStackedErofsTempMount and TestWithActiveSnapshotMountOverlay) Poll with a 5s deadline, matching the existing mountutils.verifyNoLoopDevice and loop.verifyDetached helpers, which already handle the same race. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Folded into #45. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
checkNoLoopDevicedid a single immediateFindByBackingFilecheck right after the temp-mount cleanup returned. The kernel releases loop devices asynchronously afterLOOP_CLR_FD/ autoclear, so a backing file can still resolve to a device for a short window after cleanup — causing flaky failures:Observed in
TestWithStackedErofsTempMountandTestWithActiveSnapshotMountOverlay(root tests).Fix
Poll with a 5s deadline, matching the existing helpers that already handle the same race:
mountutils/erofs_linux_test.go:verifyNoLoopDeviceloop/loop_linux_test.go:verifyDetachedBoth already document "the kernel may release loop devices asynchronously" and poll. This makes
checkNoLoopDeviceconsistent.Test-only change; no production code touched.
Testing
GOOS=linux go vet ./internal/differ/— cleantask lint— 0 issues🤖 Generated with Claude Code