All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [rfc][patch] mm: half-fix page tail zeroing on write problem
Date: Fri, 2 Feb 2007 17:29:06 +1100	[thread overview]
Message-ID: <17858.55858.642522.861130@notabene.brown> (raw)
In-Reply-To: message from Nick Piggin on Friday February 2

On Friday February 2, npiggin@suse.de 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

WARNING: multiple messages have this Message-ID (diff)
From: Neil Brown <neilb@suse.de>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [rfc][patch] mm: half-fix page tail zeroing on write problem
Date: Fri, 2 Feb 2007 17:29:06 +1100	[thread overview]
Message-ID: <17858.55858.642522.861130@notabene.brown> (raw)
In-Reply-To: message from Nick Piggin on Friday February 2

On Friday February 2, npiggin@suse.de 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-02-02  6:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-02  5:51 [rfc][patch] mm: half-fix page tail zeroing on write problem Nick Piggin
2007-02-02  5:51 ` Nick Piggin
2007-02-02  6:29 ` Neil Brown [this message]
2007-02-02  6:29   ` Neil Brown
2007-02-02  7:21   ` Nick Piggin
2007-02-02  7:21     ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17858.55858.642522.861130@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.