In article <cs.lists.linux-fsdevel/20000405104700$[EMAIL PROTECTED]> you
wrote:
> AFAICS the memset() for new buffer blocks is wrong:
>
> memset(kaddr+to,0, block_end-to)
>
> It should be
>
> memset(kaddr+max(to,block_start),0,block_end-to)
>
> example:
> 1 kB block size,
> block 0: "old"
> block 1: "old"
> block 2: new
> block 3: new
> from=0
> to=512
>
> now the memset will overwrite the contents of of block 1 when it initializes
> block 2 or 3.
The current implementation will also populate the page cache with pages
that are not Uptodate, but are not Locked either, which is clearly a bug.
It will always happen if there is a partial write to a page, e.g. if a program
creates a file and then writes 1.5k worth of data, on a 1k-block filesystem.
It should be fixed either by getting all the buffers within the page Uptodate,
or by throwing away the page at the end of the write operation.
Ion
--
It is better to keep your mouth shut and be thought a fool,
than to open it and remove all doubt.