Re: [rfc][patch] mm: half-fix page tail zeroing on write problem



On Friday February 2, npiggin@xxxxxxx wrote:
Hi,

For no important reason, I've again looked at those zeroing patches that
Neil did a while back. I've always thought that a simple
`write(fd, NULL, size)` would cause the same sorts of problems.

Yeh, but who in their right mind would do that???
Oh, you did :-)


Turns out it does. If you first write all 1s into a page, then do the
`write(fd, NULL, size)` at the same position, you end up with all 0s in
the page (test-case available on request). Incredible; surely this
violates the spec?

Does it?
I guess filling with zeros isn't what one would expect, but you could
make a case for it being right.
write(fd, 0, size)
writes 'size' 0s. Cool. Ok, bad-cool.


The buffered-write fixes I've got actually fix this properly, but they
don't look like getting merged any time soon. We could do this simple
patch which just reduces the chance of corruption from a certainty down
to a small race.

Any thoughts?

I cannot see why you make a change to fault_in_pages_writeable. Is it
just for symmetry?
For the rest, it certainly makes sense to return an early -EFAULT if
you cannot fault in the page.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [rfc][patch] mm: half-fix page tail zeroing on write problem
    ... I've again looked at those zeroing patches that ... Neil did a while back. ... all the more reason to be careful about correct behaviour. ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Yet more on Neils "download" comment...
    ... Where's the "Let It Be" DVD in your timetable for world, Neil? ... I can only think of two 'releases' which have been as hung as most of the Apple stash: ... The reason of why no LIB DVD? ...
    (rec.music.beatles)
  • Re: conduct--see post below
    ... They do Neil, but things have been getting out of control in this group ... That is the main reason I haven't posted here recently. ... Unofficial FAQ for Windows Server 2003 at ...
    (microsoft.public.cert.exam.mcse)
  • Re: Manchester Picc to close for a day 15 Oct
    ... but I can think of no good reason for Saturday, ... appear to be operating LiverpoolStaly trains via Vic at xx48 ... Unless, of course, the new Chat Moss express does eat all the ... Neil Williams in Milton Keynes, ...
    (uk.railway)
  • Re: NRE website
    ... >>Anyone able to explain why querying the NRE website for Sunday services ... > services appear to be terminating at Hunts Cross. ... which is probably the reason for the lack of capacity. ... > Neil Williams in Milton Keynes, ...
    (uk.railway)