Skip to content

Tags: folbricht/desync

Tags

v1.0.2

Toggle v1.0.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix reflink cloning on filesystems with large block sizes such as ZFS (

…#356)

* Fix reflink cloning on filesystems with large block sizes such as ZFS

OpenZFS 2.2+ implements FICLONERANGE, so the CanClone probe now succeeds
on ZFS, but actual clones often fail: ZFS requires alignment to its
recordsize (128k by default, reported as st_blksize) and returns EAGAIN
when the source range hasn't been committed to disk yet. Extraction with
seeds then failed with "invalid argument" or "resource temporarily
unavailable" errors.

On top of that, the clone math in fileSeedSegment and nullChunkSection
assumed every segment contains at least one full aligned block, which is
always true for 4k blocks but not for 128k ones. Segments smaller than a
block made the aligned length underflow, made the head/tail copies write
outside the segment, and could call FICLONERANGE with a zero length,
which the kernel interprets as "clone to the end of the source file",
silently corrupting the target.

Guard against ranges that contain no full aligned block by copying them
instead, and fall back to copying the blocks whenever CloneRange fails.
Cloning failures are no longer fatal on any filesystem.

Verified against a real ZFS pool (zfs 2.2.2, zfs_bclone_enabled=1):
previously failing extraction tests now pass and properly aligned ranges
are still reflinked.

Fixes #353

* Fall back to copying silently when cloning fails, like cp does

v1.0.1

Toggle v1.0.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix help text issues across cmd/desync subcommands (#332)

- mount-index: replace non-existent `-x` in example with `--cor-file`
- extract: correct `-seed`/`-seed-dir` to `--seed`/`--seed-dir` in description
- inspect-chunks, info: align second example line indent with first
- chunk-server, index-server: rename `--writeable` flag to `--writable`,
  keep `--writeable` as a deprecated alias for backward compatibility
- inspect-chunks: rename `newinspectChunksCommand` to `newInspectChunksCommand`
- root: drop trailing period from Short for consistency
- untar: add missing article in Short ("Extract a directory tree ...")
- cache: fix awkward `index(s)` in --ignore flag help

v1.0.0

Toggle v1.0.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Do not call t.Fatal() from non-main goroutines (#291)

Calling t.Fatal() only stops the current goroutine, but not the rest.
The result is different depending on a test, but in the worst case
scenario (like an error in the server part of a test) the client may
hang waiting indefinitely for the response, and the test ends with
a panic from the test timeout, without showing the real reason for
the issue.

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht

Verified

This tag was signed with the committer’s verified signature.
folbricht Frank Olbricht