Re: 2.4.0-test8-pre1 is quite bad / how about integrating Rik's VM now?

From: Benjamin Herrenschmidt (
Date: Sun Sep 03 2000 - 06:27:56 EST

Hi !

I've read the discussion about the truncate() problem and tried to
understand ;) However, there's somethign I don't catch in your code (typo
? bug ? misunderstanding on my side ?)

Linus wrote:

There's a really simple way to avoid this: compare the thing you're going
to zero out against zero before you memset() it to zero. If it was already
zero, you just unlock the page and release.

Your code does:

>+ kaddr = (char*)kmap(page);
>+ err = 0;
>+ if (!mem_is_zero(kaddr+offset, length))
>+ goto unmap;
>+ memset(kaddr+offset, 0, length);
>+ flush_dcache_page(page);
>+ __block_commit_write(inode, page, offset, offset+length);
>+ kunmap(page);

Which seem to be the the opposite of what Linus says: You memset() the
page when it's _already_ zero and exit when it's not.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:15 EST