public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Karl Schendel <kschendel@datallegro.com>
To: Zach Brown <zach.brown@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	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>,
	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 18:41:40 -0400	[thread overview]
Message-ID: <47226D24.30802@datallegro.com> (raw)
In-Reply-To: <47226A75.1020008@oracle.com>

Zach Brown wrote:
> Linus Torvalds wrote:
>> Hmm. If I read this right, this bug seems to have been introduced by 
>> commit 65b8291c4000e5f38fc94fb2ca0cb7e8683c8a1b ("dio: invalidate clean 
>> pages before dio write") back in March.
> 
> Agreed.  And it's a really dumb bug.  ->direct_io will almost always
> return -EIOCBQUEUED for aio dio so it won't be invalidating for aio dio
> writes.  (Notice that the testing in that commit mentions two racing
> processes, I bet U$1M that I only tested sync dio :/)

Well, actually, in this case both processes are doing sync IO.
It's just that the writer is direct and the reader isn't, with
the reader usually behind the writer but close enough that
readahead crosses the writer reasonably often.  With the
if (retval) test, we only invalidate if nothing got written
at all!

I hadn't even thought of aio directio.  Yeah, the invalidate
should happen for -EIOCBQUEUED as well, I guess.

The disparity in direct-io-ness on the part of the reader
vs writer is a userland dum-dum, no question.  (That's
getting fixed, too.)

Karl


  reply	other threads:[~2007-10-26 22:41 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 [this message]
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

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=47226D24.30802@datallegro.com \
    --to=kschendel@datallegro.com \
    --cc=akpm@linux-foundation.org \
    --cc=bcrl@kvack.org \
    --cc=chris.mason@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@linux-foundation.org \
    --cc=zach.brown@oracle.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