Skip to content

Fix "failed to create hardlink" error due to multiple mounts on the same device (Cherry-pick of #19894) - #19910

Merged
stuhood merged 1 commit into
2.18.xfrom
cherry-pick-19894-to-2.18.x
Sep 22, 2023
Merged

Fix "failed to create hardlink" error due to multiple mounts on the same device (Cherry-pick of #19894)#19910
stuhood merged 1 commit into
2.18.xfrom
cherry-pick-19894-to-2.18.x

Conversation

@WorkerPants

Copy link
Copy Markdown
Member

As described in #18757, the "check that source and dest are on same device" strategy that was introduced in #18153 to decide whether we could hardlink when materializing files was not robust when faced with the same device being mounted in multiple locations.

This change moves to a "create a canary" strategy for deciding when hardlinking between two destinations is legal. Hardlinks are canaried and memoized on a per-destination-root basis, so this strategy might actually be slightly cheaper than the previous one.

Fixes #18757.

…ame device (#19894)

As described in #18757, the "check that source and dest are on same
device" strategy that was introduced in #18153 to decide whether we
could hardlink when materializing files was not robust when faced with
the same device being mounted in multiple locations.

This change moves to a "create a canary" strategy for deciding when
hardlinking between two destinations is legal. Hardlinks are canaried
and memoized on a per-destination-root basis, so this strategy might
actually be slightly cheaper than the previous one.

Fixes #18757.
@stuhood
stuhood force-pushed the cherry-pick-19894-to-2.18.x branch from b138b96 to c878d3b Compare September 22, 2023 14:30
@stuhood
stuhood merged commit a34d37b into 2.18.x Sep 22, 2023
@stuhood
stuhood deleted the cherry-pick-19894-to-2.18.x branch September 22, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:bugfix Bug fixes for released features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants