]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When a file is partially truncated, we first check to see if the
authorKirk McKusick <mckusick@FreeBSD.org>
Thu, 13 Dec 2001 05:07:48 +0000 (05:07 +0000)
committerKirk McKusick <mckusick@FreeBSD.org>
Thu, 13 Dec 2001 05:07:48 +0000 (05:07 +0000)
commit9db12e5108cb95b8e1d82eba7ff5f2b32331e3a6
treea98ceef299b1c81f7b5aaeec89abdf242330b72b
parentbcb733d069ee3a1768be54caf89be82b6a902b52
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
sys/ufs/ffs/ffs_inode.c