On Thu, Feb 25, 2021 at 7:23 PM Shiyang Ruan <ruansy.fnst@xxxxxxxxxxx> wrote: > > This patchset is attempt to add CoW support for fsdax, and take XFS, > which has both reflink and fsdax feature, as an example. > > Changes from V1: > - Factor some helper functions to simplify dax fault code > - Introduce iomap_apply2() for dax_dedupe_file_range_compare() > - Fix mistakes and other problems > - Rebased on v5.11 > > One of the key mechanism need to be implemented in fsdax is CoW. Copy > the data from srcmap before we actually write data to the destance > iomap. And we just copy range in which data won't be changed. > > Another mechanism is range comparison. In page cache case, readpage() > is used to load data on disk to page cache in order to be able to > compare data. In fsdax case, readpage() does not work. So, we need > another compare data with direct access support. > > With the two mechanism implemented in fsdax, we are able to make reflink > and fsdax work together in XFS. > > > Some of the patches are picked up from Goldwyn's patchset. I made some > changes to adapt to this patchset. > > (Rebased on v5.11) Forgive my ignorance, but is there a reason why this isn't wired up to Btrfs at the same time? It seems weird to me that adding a feature like DAX to work with CoW filesystems is not being wired into *the* CoW filesystem in the Linux kernel that fully takes advantage of copy-on-write. I'm aware that XFS supports reflinks and does some datacow stuff, but I don't know if I would consider XFS integration sufficient for integrating this feature now, especially if it's possible that the design might not work with Btrfs (I hadn't seen any feedback from Btrfs developers, though given how much email there is here, it's entirely possible that I missed it). -- 真実はいつも一つ!/ Always, there's only one truth!