In article <email@example.com>,
Henrik =?ISO-8859-1?Q?St=F8rner?= <firstname.lastname@example.org> wrote:
>I am one of the people who have been seeing this problem. I would be
>very surprised if it was an ext2 problem, as the only ext2 filesystem
>on my disk contains all of /boot. No programs, no news spool on ext2 -
>nada. I use reiserfs for all of that.
It may be that the problem exists on other filesystems: the ext2 bug was
that when truncating a file, the last (partial) block of a file would
not be truncated (ie last part of the block zeroed out) on-disk. We
screwed that up when we did the new page-cache stuff, and people that
looked at what ext2 did may have inadvertedly introduced the same bug in
other filesystems (eg reiserfs).
This is often hidden by the fact that when it _is_ truncated in memory,
that truncated copy often ends up being dirty and written back to disk
anyway, so a lot of the trivial test-programs were entirely unable to
show this behaviour, because they hid the bug by having tmp-files that
were dirty and in-memory and pending to be written out anyway.
Hmm.. Looking at the test8-pre2 patches, that case is not actually
fixed yet - it only has the "preparation" patch for the final thing.
Al? Can you send out the final part too?
Anyway, the way to test if you have the bug is this simple program from
Al Viro who noticed the bug and has the fix - notice that you need to
have some file that is clean, non-zero and NOT in memory (ie an old
forgotten /tmp entry that can be happily trashed by the test-program):
char dummy = '\0';
truncate(argv, 1); /* everything but the first byte must die */
fd = open(argv, 1);
lseek(fd, 8192, 0); /* past the first block */
write(fd, &dummy, 1); /* now reading from offsets 1--8192 should */
/* yield zeroes */
and then do
If you have the bug even on reiserfs, you'll get tons of old stuff
between offsets 1-8192. If the bug is not there, you'll get zeroes like
the comment says you should.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:14 EST