What filesystem operations are required to be atomic?

Dan D. picture Dan D. · Mar 8, 2011 · Viewed 8.1k times · Source

Are unlink, fsync, and rename the only ones that are by definition atomic?

Edit: atomic means that an operation either succeeds and has an effect or has fails and has no effect; an operation must not fail and have an effect.

clearly if the kernel panics, the program can't handle the error of the operation failing but it must consider in this case that it did fail

Answer

Kornel picture Kornel · Jun 13, 2014

Here's an article listing some atomic file operations:

http://rcrowley.org/2010/01/06/things-unix-can-do-atomically.html

mv, link, symlink, mkdir and some ways of opening files are atomic.