Reflink pool driver on ZFS?

I’d like to get opinions on the trade-offs in using the ZFS pool driver vs. using the Reflink pool driver backed by ZFS. Ideally, I’d like to hear from people experienced with the differences in the internal workings of block-cloned files vs. zvols and the differences in the current implementations of both pool drivers (@Rudd-O ?) Some areas of concern are which features are missing from either approach and what are the different performance characteristics.

file-reflink backed by the ZFS filesystem is definitely much more uncommon. I’ve only ever heard of one person with that setup.

There are different ZFS knobs that might be worth tuning for the file-reflink driver (recordsize) vs. the zfs driver ( volblocksize) to deal with fragmentation, but I can’t tell you anything specific about that. Nor about typical performance.

AFAIK there isn’t any difference in features. file-reflink implements all features of the Qubes OS storage API, and so does zfs I assume.

Implementation wise, there’s some symmetry in that file-reflink is relatively simple and maybe a bit more battle tested from usage (in general, not backed by the ZFS filesystem!), but reflinking uses a complex and recent feature of the ZFS filesystem (the block reference table); whereas the zfs driver is somewhat more complex and recent, but sticks to tried-and-true features of the ZFS filesystem.

I missed that thread, thanks for sharing.

Right, what I meant was more about features on the ZFS side. For instance, FIDEDUPERANGE recently landed in openzfs master, which only is allowed on files, and as far as I know, there’s not an alternate mechanism for offline deduping zvols. If in theory it should be not too hard to have one now, but zfs would likely need to create a way to do it that by-passes the kernel. Also, the offline dedupe tool I’d like to use requires FIEMAP, which I hope lands in the near future in openzfs, but will only apply to files also. FIEMAP in particular could potentially be mitigated by scripting zdb to get the same data for zvols, but its much less elegant and something that I’d have to build.

These are big reasons for wanting to use the reflink driver for me, but I wonder what I’m giving up. What might I be able to do directly with Zvols that I can’t do with zfs files?

Yes, and IIRC, ZFS already had a nasty reflink bug. So, its definitely a concern.