linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Tim LaBerge <tim.laberge@quantum.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: Corruption with O_DIRECT and unaligned user buffers
Date: Wed, 19 Nov 2008 17:58:19 +0100	[thread overview]
Message-ID: <20081119165819.GE19209@random.random> (raw)
In-Reply-To: <200811191526.00036.nickpiggin@yahoo.com.au>

On Wed, Nov 19, 2008 at 03:25:59PM +1100, Nick Piggin wrote:
> The solution either involves synchronising forks and get_user_pages,
> or probably better, to do copy on fork rather than COW in the case
> that we detect a page is subject to get_user_pages. The trick is in
> the details :)

We already have a patch that works.

The only trouble here is get_user_pages_fast, it breaks the fix for
fork, the current ksm (that is safe against get_user_pages but can't
be safe against get_user_pages_fast) and even migrate.c
memory-corrupts against O_DIRECT after the introduction of
get_user_pages_fast.

So I recommend focusing on how to fix get_user_pages_fast for any of
the 3 broken pieces, then hopefully the same fix will work for the
other two.

fork is special in that it even breaks against get_user_pages but
again we've a fix for that. The only problem without a solution is how
to serialize against get_user_pages_fast. A brlock was my proposal,
not nice but still better than backing out get_user_pages_fast.

  parent reply	other threads:[~2008-11-19 16:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 17:04 Corruption with O_DIRECT and unaligned user buffers Tim LaBerge
2008-11-19  4:25 ` Nick Piggin
2008-11-19  6:52   ` Nick Piggin
2008-11-19 16:58   ` Andrea Arcangeli [this message]
2008-12-18 15:29     ` Andrea Arcangeli
2008-12-19  2:21       ` KAMEZAWA Hiroyuki
2008-12-19  5:06         ` KAMEZAWA Hiroyuki
2008-12-19  6:34       ` KOSAKI Motohiro
2008-12-20 16:02         ` Andrea Arcangeli
2008-12-19  7:19       ` KAMEZAWA Hiroyuki
2008-12-19  7:44         ` Li Zefan
2008-12-19  8:45           ` Li Zefan
2008-12-19 20:27           ` Andrea Arcangeli
2008-12-20 15:55         ` Andrea Arcangeli
2008-12-19 11:51       ` Li Zefan
2008-12-19 12:14         ` KOSAKI Motohiro
2008-12-19 12:58         ` Hugh Dickins
2008-12-19 20:34         ` Andrea Arcangeli

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=20081119165819.GE19209@random.random \
    --to=aarcange@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=tim.laberge@quantum.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).