Subject: Re: Potential NetBSD 1.6 LFS bug
To: Zhihui Zhang <bf20761@binghamton.edu>
From: Konrad Schroder <perseant@hhhh.org>
List: tech-kern
Date: 03/05/2003 12:21:13
On Tue, 4 Mar 2003, Zhihui Zhang wrote:

> A small file is initially allocated 5 fragments (one fragment is 1024
> bytes, one block is 8192 bytes). Then it extends to 8 fragments. The
> i_size and i_lfs_effnblks are set correctly.  But the value of
> i_ffs_blocks is still 5. When this file is written, lfs_updatemeta() can
> not increase i_ffs_blocks properly because (1) the address is not
> UNWRITTEN (2) it has no way of knowing that it should increase
> i_ffs_blocks by exactly 3.

Your analysis is right on.  The problem is fixed in -current, though;
there is an inode extension that records the lengths of the on-disk
fragments, and lfs_updatemeta updates i_ffs_blocks when it sees the sizes
change.
						Konrad Schroder
						perseant@hhhh.org