Dave Chinner <david@xxxxxxxxxxxxx> wrote: > If we can forsee that users are going to complain that > linkat(AT_REPLACE) using O_TMPFILE files is not atomic because it > leaves zero length files behind after a crash just like rename() > does, then we haven't really improved anything at all... For my purposes, I would like it to look like the end result of unlink()+linkat(). I need to avoid losing the metadata in case of disconnected operation. Now, I can do it like Miklós suggested and have a bunch of temporary dirs to iterate round, then create new files there and rename over the target file. I'm using direct I/O, so I'm assuming I don't need to fsync(). David