On 2021-06-09, Jan Engelhardt <jengelh@inai.de> wrote:
On Wednesday 2021-06-09 03:06, Aleksa Sarai wrote:
To play devil's advocate, not all in-tree Linux filesystems support RENAME_EXCHANGE either[1][..] none of those filesystems are supported as a root partition on openSUSE either, but it's a bit unfair to pretend that this is somehow a ZFS-specific thing.
But as it happens, I worked on a patch some time ago to add RENAME_EXCHANGE support to OpenZFS[2][...]
[1]: affs, afs, btrfs, ext*, f2fs, fuse, gfs2, overlayfs, ubifs, xfs all support it at the moment but there are 78 in-kernel filesystems so 68 don't support it including (though "filesystems" here includes pseudo-filesystems and remote filesystems like nfs).
Would it be possible/feasible to add a fallback at the VFS layer that does a mutexed-off 3-part rename?
It would be possible of course, but I would expect that the atomicity requirement is the same as stock rename(2) -- it has to be done such that it's crash resistant. But I don't know if that's a formal requirement of the feature... -- Aleksa Sarai Senior Software Engineer (Containers) SUSE Linux GmbH <https://www.cyphar.com/>