3 ms·
If you crash at (3) you can -- at least in principle -- have "link" pointing to garbage (most likely an empty file). That is, the dirent points to the new inod
by adrianratnapala 10y ago
If you crash at (3) you can -- at least in principle -- have "link" pointing to garbage (most likely an empty file). That is, the dirent points to the new inode, but the actual link-text got lost with the crash.
Now on modern filesystems, a non-huge symlink will be stored in the inode itself and presumably enjoys some sort of atomicity. But there is nothing in the standard about that.
- geocar 10y ago> If you crash at (3) you can -- at least in principle -- have "link" pointing to garbage (most likely an empty file). No, I don't think you can, bugs notwithstanding. A "link" (§3.130) is what POSIX calls a directory entry. > But there is nothing in the standard about that. The "standard" (POSIX) doesn't talk much about crashing, however if mkdir("a") could destroy "b" – even during a system crash (§3.387), then users would complain.