Traditionally, filesystem consistency has been maintained across system failures either by using synchronous writes to sequence dependent metadata updates or by using write-ahead logging to atomically group them. Soft updates, an alternative to these approaches, is an implementation mechanism that tracks and enforces metadata update dependencies to ensure that the disk image is always kept consistent. The use of soft updates obviates the need for a separate log or for most synchronous writes. Indeed, the ability of soft updates to aggregate many operations previously done individually and synchronously reduces the number of disk writes by 40 to 70% for file-intensive environments (e.g., program development, mail servers, etc.). In addition to performance enhancement, soft updates can also maintain better disk consistency. By ensuring that the only inconsistencies are unclaimed blocks or inodes, soft updates can eliminate the need to run a filesystem check program after every system crash. Instead, the system is brought up immediately.
When it is convenient, a snapshot is taken and a background task can be run on on that snapshot to reclaim any lost blocks and inodes. The use of a snapshot allows normal filesystem activity to continue concurrently.
A key feature of these snapshots is that they usually require filesystem write activity to be suspended for less than one second. The suspension time is independent of the size of the filesystem. To reduce the number and types of corruption, soft updates were added to ensure that the only filesystem inconsistencies are lost resources. With these two additions it is now possible to bring the system up immediately after a crash and then run checks to reclaim the lost resources on the active filesystems.
The soft updates code is available in the currently released freely-available BSD systems: FreeBSD, NetBSD, and OpenBSD. Snapshots and back-ground fsck are available in FreeBSD 5.0 and later. Effective June 21, 2000 the soft updates, snapshot, and back-ground fsck code was released under a Berkeley-style copyright which allows unrestricted use in source and binary forms for commercial or non-commercial use.
For details on the implementation of both soft updates and snapshots click here. For a comparison of soft updates versus logging click here. For information about back-ground fsck click here. For information about journaled soft updates click here.