Re: What is needed for ZFS block cloning to work?

"Rob Norris" <[email protected]> Wed, 15 Jul 2026 11:53:50 +1000
Newsgroups gmane.os.freebsd.devel.file-systems
Message-ID <[email protected]>
--7cfcaf2023a14be77d661f7db1d049794a07c52d
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 13 Jul 2026, at 10:21 AM, Rob Norris wrote:
> On Mon, 13 Jul 2026, at 10:18 AM, Rick Macklem wrote:
>> For FreeBSD, if cloning or failure of the copy_file_range(2) syscall is
>> desired, the flag argument COPY_FILE_RANGE_CLONE can be specified.
>> (to avoid the fallback to the copy loop in the kernel syscall)
> 
> Oh, interesting! That wasn't there when we first wired it up (pretty sure). I'll check if that's working properly against ZFS. At minimum, I'll re-work the FICLONERANGE tests to use it.

FWIW, that's now being tested in the upstream test suite: https://github.com/openzfs/zfs/pull/18788

Rob.

--7cfcaf2023a14be77d661f7db1d049794a07c52d
Content-Type: text/html
Content-Transfer-Encoding: 7bit

<!DOCTYPE html><html><head><title></title></head><body><div>On Mon, 13 Jul 2026, at 10:21 AM, Rob Norris wrote:</div><blockquote type="cite" id="qt" style=""><div>On Mon, 13 Jul 2026, at 10:18 AM, Rick Macklem wrote:</div><blockquote type="cite" id="qt-qt" style=""><div>For FreeBSD, if cloning or failure of the copy_file_range(2) syscall is</div><div>desired, the flag argument COPY_FILE_RANGE_CLONE can be specified.</div><div>(to avoid the fallback to the copy loop in the kernel syscall)</div></blockquote><div><br></div><div>Oh, interesting! That wasn't there when we first wired it up (pretty sure). I'll check if that's working properly against ZFS. At minimum, I'll re-work the FICLONERANGE tests to use it.</div></blockquote><div><br></div><div>FWIW, that's now being tested in the upstream
  test suite: <a href="https://github.com/openzfs/zfs/pull/18788">https://github.com/openzfs/zfs/pull/18788</a></div><div><br></div><div>Rob.</div><div><br></div></body></html>
--7cfcaf2023a14be77d661f7db1d049794a07c52d--