We recently delved into the concept of "Soft Updates" as a mean of maintaining a Filesystem as consistent. The solution, as we learned it, calls for 3 basic rules:
- We'll create a pointer to a file only after the file (Inode) has been created.
- To reuse a block, we will first remove all Inode pointers to it.
- For rename() operations, we will first create the new pointer, and only then remove the previous one.
While all of it is mostly understood, I had difficulty understanding why cyclic dependencies occur. The example that's always being given is the one where two actions are needed to take place, both creation and deletion, using the same Inode Block of a directory and its contents. The series of actions is as follows: 1. Create File 2. Remove File
My question is: why would this cause cyclic dependency? Since these are two seperate actions, why can't we complete the first one, in the relevant order of steps it needs, and only then do the other? Can someone please describe step for step why eventually we would enter a loop, and why both of these actions cause it?
I've searched for deeper explanation in many places, but no clear answer has been given. Any help would be appreciated!