Thread (9 messages) read the whole thread 9 messages, 4 authors, 2016-12-02

Re: [RFC PATCH 1/3] fs: add AT_REPLACE flag for linkat() which replaces the target

From: Colin Walters <hidden>
Date: 2016-11-22 19:06:20
Also in: linux-fsdevel

On Tue, Nov 22, 2016, at 03:25 AM, Omar Sandoval wrote:
From: Omar Sandoval <redacted>

One of the most common uses of temporary files is the classic atomic
replacement pattern, i.e.,

- write temporary file
- fsync temporary file
- rename temporary file over real file
- fsync parent directory

Now, we have O_TMPFILE, which gives us a much better way to create
temporary files, but it's not possible to use it for this pattern.
FWIW, I have some userspace code that indeed wants exactly this:

https://github.com/GNOME/libglnx/blob/36396b49ad6636c9959f3dfac5e04d41584b1a92/glnx-fdio.c#L232

So if we add this, I'd presumably change the code to try it and
fall back on EINVAL as usual?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help