logoalt Hacker News

creatonez05/01/20251 replyview on HN

From Linux kernel documentation:

https://man7.org/linux/man-pages/man2/ioctl_ficlone.2.html

> Clones are atomic with regards to concurrent writes, so no locks need to be taken to obtain a consistent cloned copy.

I'm not aware of any of the filesystems that use it (Btrfs, XFS, Bcachefs, ZFS) that deviate from expected atomic behavior, at least with single files being the atom in question for `FICLONE` operation.


Replies

vlovich12305/01/2025

Thanks! I similarly thought that a file clone would work but I couldn't confirm it.