[go: up one dir, main page]

|
|
Log in / Subscribe / Register

A way to do atomic writes

A way to do atomic writes

Posted May 30, 2019 5:44 UTC (Thu) by qtplatypus (guest, #132339)
Parent article: A way to do atomic writes

I have been thinking about this and I'm wondering if on fs that support it ioctl_ficlone it might leveraged to make atomic writes of the A without D type that many application devs desire.

A sequence of

create B
ioctl_ficlone B from A
write to B
ioctl_ficlone A from B

Though that looks too simple and there may be something I'm missing.


to post comments

A way to do atomic writes

Posted May 30, 2019 12:36 UTC (Thu) by Jonno (guest, #49613) [Link]

> Though that looks too simple and there may be something I'm missing.

For crash consistency, you have to at least add an `fdatasync B` before `ioctl_ficlone A from B`, or you might get garbage in A after recovery. It also depends upon the filesystem writing the new extent mapping of A to disk atomically, which I don't think is actually guaranteed (though most filesystems probably do so anyway).


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds