perf: remember a filesystem without reflink and say so once - #206
Merged
Conversation
ReflinkCopy tried FICLONE on every disk copy and fell back silently, so an ext4 root paid a create, ioctl and unlink per clone and nobody saw that every clone was a full copy. The destination's filesystem id is cached the first time FICLONE answers EOPNOTSUPP or ENOTTY, later copies go straight to SparseCopy, and one warning names the filesystem. The copy takes the caller's context for that log.
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.
ReflinkCopy tried FICLONE on every disk copy and fell back to SparseCopy silently, so on an ext4 root every clone paid a create, ioctl and unlink for nothing and the operator never learned that clones copy their disks in full (audit item cocoon-host D1).
Consumers: cocoon-macos calls
utils.ReflinkCopyat two sites (cmd/vm/datadisk.go,cmd/vm/utils.go); they gain the context argument when cocoon-macos next bumps its cocoon pin.Hot path: one statfs per disk copy on the clone path (a few µs) and, on a reflink-less filesystem, three syscalls fewer per copy.