Subject: Re: FFS reliability problems
To: None <>
From: David Laight <>
List: tech-kern
Date: 05/19/2002 18:14:07
On Sat, May 18, 2002 at 09:30:30PM -0700, Greywolf wrote:
> It initiated the save to a zero-length file, then the system crashed,
> I rebooted it, and fsck happily cleared all those blocks associated with
> inodes that had no reference count.

Ah - the zero length file contains no information!
IIRC POSIX requires that and truncate request actually
write out the inode.  Since UFS/FFS use the file size as
part of the block list (it controls the number of fragments
in the last block), setting the size to zero enforces
freeing of all the blocks associated with the file.
Unfortunately close() doesn't have to update the inode
- neither do you probably want it to?

I suspect the temporary files would be insome internal
format and impoosible to decode!


David Laight: