freebsd-dev/sys/ufs/ffs
mckusick 240246479c When a file is partially truncated, we first check to see if the
new file end will land in the middle of a file hole. Since the last
block of a file must always be allocated, the hole is filled by
allocating a block at that location. If the hole being filled is
a direct block, then the truncation may eventually reduce the
full sized block down to a fragment. When running with soft
updates, it is necessary to FSYNC the file after allocating the
block and before creating the fragment to avoid triggering a
soft updates inconsistency when the block unexpectedly shrinks.

Found by:	Matthew Dillon <dillon@apollo.backplane.com>
MFC after:	1 week
2001-12-13 05:07:48 +00:00
..
ffs_alloc.c o Replace two direct uid!=0 comparisons with suser_xxx() calls. 2001-10-02 14:41:43 +00:00
ffs_balloc.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
ffs_extern.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
ffs_inode.c When a file is partially truncated, we first check to see if the 2001-12-13 05:07:48 +00:00
ffs_snapshot.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
ffs_softdep_stub.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
ffs_softdep.c - Fix some minor whitespace nits. 2001-09-27 21:04:13 +00:00
ffs_subr.c Remove blatantly pointless call to VOP_BMAP(). 2001-05-01 09:12:31 +00:00
ffs_tables.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ffs_vfsops.c Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has a 2001-10-26 00:08:05 +00:00
ffs_vnops.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
fs.h Use a fixed type for times in on-disk structures for ufs rather than 2001-07-16 00:55:27 +00:00
README.snapshot Update to describe use of mdconfig instead of deprecated vnconfig. 2001-04-14 18:32:09 +00:00
README.softupdates Update to reflect current status. 2000-07-08 02:31:21 +00:00
softdep.h When a new block is allocated to a directory, an fsync of a file 2001-05-17 07:24:03 +00:00

$FreeBSD$

Using Soft Updates

To enable the soft updates feature in your kernel, add option
SOFTUPDATES to your kernel configuration.

Once you are running a kernel with soft update support, you need to enable
it for whichever filesystems you wish to run with the soft update policy.
This is done with the -n option to tunefs(8) on the UNMOUNTED filesystems,
e.g. from single-user mode you'd do something like:

	tunefs -n enable /usr

To permanently enable soft updates on the /usr filesystem (or at least
until a corresponding ``tunefs -n disable'' is done).


Soft Updates Copyright Restrictions

As of June 2000 the restrictive copyright has been removed and 
replaced with a `Berkeley-style' copyright. The files implementing
soft updates now reside in the sys/ufs/ffs directory and are
compiled into the generic kernel by default.


Soft Updates Status

The soft updates code has been running in production on many
systems for the past two years generally quite successfully.
The two current sets of shortcomings are:

1) On filesystems that are chronically full, the two minute lag
   from the time a file is deleted until its free space shows up
   will result in premature filesystem full failures. This
   failure mode is most evident in small filesystems such as
   the root. For this reason, use of soft updates is not
   recommended on the root filesystem.

2) If your system routines runs parallel processes each of which
   remove many files, the kernel memory rate limiting code may
   not be able to slow removal operations to a level sustainable
   by the disk subsystem. The result is that the kernel runs out
   of memory and hangs.

Both of these problems are being addressed, but have not yet
been resolved. There are no other known problems at this time.


How Soft Updates Work

For more general information on soft updates, please see:
	http://www.mckusick.com/softdep/
	http://www.ece.cmu.edu/~ganger/papers/CSE-TR-254-95/

--
Marshall Kirk McKusick <mckusick@mckusick.com>
July 2000