Soft Updates

Goal

Want to avoid crashing after “bad” subset of writes
Must follow 3 rules in ordering updates

  1. Never write pointer before initializing the structure it points to
  2. Never reuse a resource before nullifying all pointers to it
  3. Never clear last pointer to live resource before setting new one
Create file A

Block X contains inode
Block Y contains directory block
Task: create file A in inode block X and directory Y
We say Y→ X, meaning Y depends on X

  • X is dependee, Y is depender

More problems

Crash might occur between ordered but related writes

Solution

Write blocks in any order

When writing a block

In-depth structure

The structure for each updated field or pointer contains:

Operations requiring soft updates

  1. Block allocation: block pointer → free block bitmap, data block
  2. Block deallocation: free block bitmap → block pointer
  3. Link addition: directory entry → bitmap, inode
  4. Link removal: bitmap, inode → directory entry

Issues