Homework: Reliable Files and Directories

Read: The Soft Updates paper.

Look at the questions below. Then read the Soft Updates paper with the questions in mind. Then come back and answer the questions.

Hand-In Procedure

You are to turn in this homework at the beginning of lecture. Please write up your answers and hand them to a 6.828 staff member.

Reliable files and directories

Your task is to identify the dependencies among disk block updates in the xv6 file system. Update X depends on a previous update Y if Y must be written to disk before X in order to ensure that the file system would be useable (without fsck) in the event of a crash and reboot. This analysis would be required if you wanted to add soft updates (and a write-back disk block cache) to xv6.

Identify all the calls to bwrite() in xv6. (Hint: there are 7; use grep or the cross-reference in the printout.) For each call to bwrite(), identify the other bwrite()s that it can depend on. A given instance of bwrite() in the code may have multiple dependencies, and what it depends on may vary with how it is used.

Here are the answers for two of the bwrite()s:

line 3966 (in ialloc) : no dependencies.
line 4172 (in writei) : depends on balloc 3718.
                        for a directory, depends on iupdate 3990 of
                        any inode referred to by a new dirent.

Identify a cycle that could occur in the xv6 block dependencies.

This completes the homework.