cp,mv,install: Disable sparse copy on macOS#68
Closed
httpstorm wants to merge 1 commit intocoreutils:masterfrom
Closed
cp,mv,install: Disable sparse copy on macOS#68httpstorm wants to merge 1 commit intocoreutils:masterfrom
httpstorm wants to merge 1 commit intocoreutils:masterfrom
Conversation
Due to a bug in macOS, sparse copies are corrupted on virtual disks formatted with APFS. HFS is not affected. Affected are coreutils install, and gcp when compiled with SEEK_HOLE, as well as macOS Finder. While reading the entire file returns valid data, scanning for allocated segments may return holes where valid data is present. In this case a sparse copy does not contain these segments and return zeroes instead. Once the virtual disk is dismounted and then mounted again, a sparse copy produces correct results. This breaks OpenWRT build on macOS. Details: openwrt/openwrt#11960 Signed-off-by: Georgi Valkov <[email protected]>
Member
|
Thanks for the patch. |
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.
Due to a bug in macOS, sparse copies are corrupted on virtual disks formatted with APFS. HFS is not affected. Affected are coreutils
install, andgcpwhen compiled withSEEK_HOLE, as well as macOS Finder.While reading the entire file returns valid data, scanning for allocated segments may return holes where valid data is present. In this case a sparse copy does not contain these segments and return zeroes instead. Once the virtual disk is dismounted and then mounted again, a sparse copy produces correct results.
OpenWRT recently switched to
coreutils-9.1, and we need to fix the build environment.The new sparse copy support since version 9 breaks the build on macOS:
openwrt/openwrt#11960
openwrt/openwrt#11960 (comment)
The issue is most likely within APFS, So we need to bring it to Apple's attention.
Since it is triggered by building
gcc, it would be helpful if they can shine some light how their tools are build and what trigger this, in order to create PoC code.steps to reproduce
Create a sparse disk image with APFS
/Volumes/testclone and build coreutils
download OpenWRT and build gcc
proof of concept