Bill and Heinz, one thing to look out for is programs that use
"[f]truncate()" and "lseek()" when they try to be clever about avoiding
large areas of zero blocks in files. Those kinds of programs tend to do
something like:
- notice that they are writing zeroes.
- instead of writing the zero area, do an "ftruncate()+lseek()" to the
first non-zero position.
The reason they tend to do this is to avoid using up disk-space: if you
actually do a write() of the zero area then the disk blocks will be
allocated, but if you just jump over the area then many filesystems will
not use any physical diskspace at all for the zeroes if they are
properly aligned etc..
In particular, the NFS client might have missed some clearing of the
page cache for the ftruncate() - or possibly there is a pending
asynchronous write() and the truncate gets re-ordered around it or
similar...
Linus