- Soft updates
In
computer file system s, soft updates are an approach to maintaining disk integrity after a crash or power outage. They are an alternative tojournaling file system s.Instead of duplicating metadata writes in a journal, soft updates work by properly ordering the metadata writes to guarantee consistency after a crash. Like journaling, soft updates do not guarantee that no data will be lost, but do make sure the filesystem is consistent.
An advantage of a file system with soft updates is that it can be mounted almost instantaneously.
Soft updates were first introduced to
FreeBSD byMarshall Kirk McKusick and are now available across the BSDs.Operation
Soft updates allow only asynchronous metadata writes that do not render the on-disk file system inconsistent, or that the only inconsistency that ever happens is a storage leak. It avoids having to do ordered synchronous meta-data writes by temporarily "rolling back" any part of a meta-data block that depends on another potentially non-flushed or partially rolled back block when writing it. In effect, blocks may be flushed at any time, and the soft-update code will always provide the disk a consistent version of it (as long as it knows which blocks have physically been flushed at this time). Recovery then simply becomes a matter of running a background walk of the file system when it is next mounted to garbage collect any data orphaned in leaks. This also permits the filesystem to selectively flush certain files without having to flush all meta-data blocks or a whole journal. Also, data that is unlinked from the meta-data dependency graph before writing it to disk has begun does not need to be written to disk at all. For example, creating a file, using it for a short period of time, and then deleting it may cause no disk activity at all. However, some disadvantages of soft updates are that it is very complex to implement correctly, that it still causes a lot of scattered meta-data writes that have to be forced to disk periodically to make sure that the on-disk FS version does not lag behind the in-core one too much, and that these scattered writes may be more likely to trigger inconsistencies when the disk flushes its internal write cache in arbitrary order.
References
* McKusick, M. (2002). [http://www.usenix.org/publications/library/proceedings/bsdcon02/mckusick/mckusick_html/index.html Running "fsck" in the Background] ." "Proceedings of the BSDCon 2002." 55-64.
* McKusick, M. and Ganger, G. (1999). " [http://www.usenix.org/publications/library/proceedings/usenix99/full_papers/mckusick/mckusick.pdf Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem] ." "USENIX Annual Technical Conference." 1-18.
* Seltzer, M. et al. (2000). " [http://www.usenix.org/publications/library/proceedings/usenix2000/general/full_papers/seltzer/seltzer_html/index.html Journaling Versus Soft Updates: Asynchronous Meta-data Protection in File Systems] ." "USENIX Annual Technical Conference." 71-84.External links
* McKusick's [http://www.mckusick.com/softdep/ own notes] on soft-updates and asynchronous writes in UFS.
Wikimedia Foundation. 2010.