Re: BUG in ext2 file-system: extending a file using lseek()

ralf@uni-koblenz.de
Mon, 16 Feb 1998 06:56:13 +0100


On Sun, Feb 15, 1998 at 11:47:40PM -0500, Chris Rankin wrote:

> I have been sweating blood trying to get my block quotas to agree on my
> ext2 partition recently - it seems that a file-system bug is partly
> responsible. I managed to produce this directory entry by extending a
> file using lseek() (according to the manual, this use of lseek is
> allowed):

> The guilty party here is the file TESTME. I trust you will agree that an
> 8016-byte file should use more than one block on a 1024 byte-blocksize
> filesystem (which I have)...
>
> I have attached the program I used to generate this result.

Files like that are said to have ``holes'' or ``sparse'' files; what you
observe is correct behaviour. The data in the unallocated blocks is read
as zero. If you're going to ever write to one of those blocks, the
filesystem will allocate them.

Ralf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu