From: Zach Brown <zach.brown@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Karl Schendel <kschendel@datallegro.com>,
Benjamin LaHaise <bcrl@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Leonid Ananiev <leonid.i.ananiev@linux.intel.com>,
Chris Mason <chris.mason@oracle.com>
Subject: Re: [PATCH] Fix bad data from non-direct-io read after direct-io write
Date: Fri, 26 Oct 2007 16:38:38 -0700 [thread overview]
Message-ID: <47227A7E.70903@oracle.com> (raw)
In-Reply-To: <alpine.LFD.0.999.0710261611511.30120@woody.linux-foundation.org>
Linus Torvalds wrote:
>
> On Fri, 26 Oct 2007, Zach Brown wrote:
>> I can throw together a patch if you haven't already committed one by the
>> time you read this ;).
>
> I'm not touching that code except to send out possible patches for others
> to test and comment on. I have no test-cases, nor any real interest in it.
> So yeah, please send me a tested and thought-through patch.
Sure thing. It looks like Karl just sent out the patch I had in mind,
so I'll run it through the tests on Monday. I assume everyone can
handle waiting that long.
> It sounded like Karl actually had a test-case to trigger this, but maybe
> I'm confused (and it sounds a bit unlikely, since it should be hard to
> trigger..
It's disappointingly easy to trigger with ext3 and ordered extending
writes. The invalidation can race with jbd pinning the bhs while it
commits the transaction. It happens that ext3 returns failure from
->releasepage if jbd is committing the transaction.
http://git.kernel.org/?p=linux/kernel/git/zab/aio-dio-regress.git;a=blob;f=c/aio-dio-invalidate-failure.c
> Although maybe you can trigger it by doing a direct_IO write
> with the *source* being an mmap() of the file you're writing to, and
> depending on the write itself re-populating the destination in the page
> cache?)
dio will definitely bring the page in with get_user_pages() but I'd like
to think that that pinned page could be safely invalidated out of the
page cache while dio holds a page reference. I've never tried it, though.
- z
prev parent reply other threads:[~2007-10-26 23:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 21:12 [PATCH] Fix bad data from non-direct-io read after direct-io write Karl Schendel
2007-10-26 21:34 ` Linus Torvalds
2007-10-26 22:10 ` Karl Schendel
2007-10-26 22:30 ` Zach Brown
2007-10-26 22:41 ` Karl Schendel
2007-10-26 22:42 ` Linus Torvalds
2007-10-26 22:54 ` Zach Brown
2007-10-26 23:14 ` Linus Torvalds
2007-10-26 23:28 ` Karl Schendel
2007-10-30 18:45 ` Zach Brown
2007-10-30 19:11 ` Linus Torvalds
2007-10-26 23:38 ` Zach Brown [this message]
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=47227A7E.70903@oracle.com \
--to=zach.brown@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bcrl@kvack.org \
--cc=chris.mason@oracle.com \
--cc=kschendel@datallegro.com \
--cc=leonid.i.ananiev@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=torvalds@linux-foundation.org \
/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