Re: 1352 NUL bytes at the end of a page? (was Re: Assertion `s && s->tree' failed: The saga continues.)

Larry McVoy
2004-05-17T14:06:10Z

On Mon, May 17, 2004 at 12:25:06AM -0700, Andrew Morton wrote:
> Linus Torvalds <torvalds@osdl.org> wrote:
> >
> > Andrew, the obvious culprit would be the memset() in fs/buffer.c
> > (block_write_full_page()
>
> There is one race.
>
> If an application does mmap(MAP_SHARED) of, say, a 2048 byte file and then
> extends it:
>
> p = mmap(..., fd, ...);
> ftructate(fd, 4096);
> p[3000] = 1;
>
> A racing block_write_full_page() could fail to notice the extended i_size
> and would decide to zap those 2048 bytes anyway.

This isn't our problem, we only read with mmap(). We write with stdio.
--
---
Larry McVoy lm at bitmover.com http://www.bitkeeper.com