ZFS Block Cloning doesn't work

I upgrade a FreeBSD system from 13.4 to 14.2.

Then I run these commands:


zpool upgrade zroot
sysctl vfs.zfs.bclone_enabled=1


But when I cp a file I see the user quota grows.

Any idea why the block cloning doesn't work?
 
Apart from block_cloning zpool-features(7) and vfs.zfs.bclone_enabled zfs(4) sysctl(8) there are lots of side conditions, just to name a few:​
  • Block cloning does not work between different pools.​
  • There is no block cloning if the source block is part of an encrypted data set and the target data set is unencrypted (or swapped roles).​
  • Block cloning can work between encrypted data sets as long as they share the same master key.​
  • If the involved data sets have different recordsizes block cloning does not work either.​
So are you sure your copy_file_range(2) is eligible for block cloning?​
 
Yes I am aware of these conditions. It's the same pool, not encrypted data set, the cp is done in same dataset.
 
Does the FreeBSD standard cp command actually use the copy_file_range(2) system call? Is using that system call actually required for ZFS to recognize that a file is being cloned, or does it also use some other heuristics? I know there are file system implementations that use instantaneous or online dedup as a heuristic to recognize cloning; or they use the sendfile(2) system call on Linux and other OSes (I don't think on FreeBSD, as there sendfile() always goes into a socket).
 
Back
Top