Journalling FS and Soft Updates comparision

Dan Nelson dnelson at
Thu Feb 10 14:23:10 PST 2005

In the last episode (Feb 10), Scott Long said:
> > journal completed.  Soft updates are simply a way to order meta
> > data so that it happens in a safe order.  An example is moving file
> > a from directory x to directory y would first delete file a from
> > dir x, then add it to dir y. If a crash happens in the middle, then
> > the data becomes lost right?
> Part of the reordering of metadata in softupdates involves generating
> dependency graphs that prevent data loss like this.

Also, note that softupdates' only job is to guarantee that the on-disk
filesystem layout is consistent.  There is no guarantee that multiple
independant metadata changes will be written to disk in the same order
they were made.  Due to the consistency rule, adding inodes to
directories is done first for things like file deletions, and last for
file creation.  A directory tree with lots of file creation and
deletion happening in it at the time of a reboot will tend to lose
files (relative to a userland application's view of the fs) when it is

> Softupdates really aren't a whole lot different from journalling. 
> Both turn metadata operations into a sequence of ordered atomic
> updates.  The only difference is that journalling writes these
> updates to the on-disk journal right away and then commits them later
> on, and softupdates keeps (most of) them in RAM and then commits them
> later on.

This is the big drawback to softupdates for me.  You run the risk of
losing the last `sysctl kern.metadelay` seconds worth of files, because
of all the state that softupdates keeps in RAM.

	Dan Nelson
	dnelson at

More information about the freebsd-fs mailing list