All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Benjamin LaHaise <bcrl@kvack.org>,
	"Ananiev, Leonid I" <leonid.i.ananiev@intel.com>,
	Zach Brown <zach.brown@oracle.com>,
	linux-aio@kvack.org, linux-kernel@vger.kernel.org,
	Suparna bhattacharya <suparna@in.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] aio: propogate post-EIOCBQUEUED errors to completion event
Date: Tue, 20 Feb 2007 11:08:54 -0500	[thread overview]
Message-ID: <20070220160854.GO6133@think.oraclecorp.com> (raw)
In-Reply-To: <1171987310.6271.23.camel@heimdal.trondhjem.org>

On Tue, Feb 20, 2007 at 11:01:50AM -0500, Trond Myklebust wrote:
> On Mon, 2007-02-19 at 19:21 -0500, Benjamin LaHaise wrote:
> > On Mon, Feb 19, 2007 at 04:50:48PM -0500, Chris Mason wrote:
> > > aio is not responsible for this particular synchronization.  Those fixes
> > > (if we make them) should come from other places.  The patch is important
> > > to get aio error handling right.
> > > 
> > > I would argue that one common cause of the EIO is userland
> > > error (mmap concurrent with O_DIRECT), and EIO is the correct answer.
> > 
> > I disagree.  That means that using the pagecache to synchronize things like 
> > the proposed online defragmentation will occasionally make O_DIRECT users 
> > fail.  O_DIRECT doesn't prevent the sysadmin from copying files or other 
> > page cache uses, which implies that generating an error in these cases is 
> > horrifically broken.  If only root could do it, I wouldn't complain, but 
> > this would seem to imply that user vs root holes still exist.
> 
> We don't try to resolve "conflicting" writes between ordinary mmap() and
> write(), so why should we be doing it for mmap and O_DIRECT?
> 
> mmap() is designed to violate the ordinary mutex locks for write(), so
> if a conflict arises, whether it be with O_DIRECT or ordinary writes
> then it is a case of "last writer wins".

There are some strange O_DIRECT corner cases in here such that the 'last
writer' may actually be a 'last reader' and winning can mean have a copy
of the page in page cache older than the copy on disk.

One option is to have invalidate_inode_pages2_range continue if it can't
toss a page but still return something that O_DIRECT ignores (living
with the race), but it looks like I can make a launder_page op that does
the right thing.  I'll give it a shot.

-chris


  parent reply	other threads:[~2007-02-20 16:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19 20:35 [PATCH] aio: propogate post-EIOCBQUEUED errors to completion event Zach Brown
2007-02-19 20:47 ` Benjamin LaHaise
2007-02-19 21:07   ` Zach Brown
2007-02-19 20:58 ` Ananiev, Leonid I
2007-02-19 21:50   ` Chris Mason
2007-02-20  0:21     ` Benjamin LaHaise
2007-02-20  0:26       ` Zach Brown
2007-02-20  0:28       ` Chris Mason
2007-02-20 16:01       ` Trond Myklebust
2007-02-20 16:06         ` Benjamin LaHaise
2007-02-20 16:06         ` Arjan van de Ven
2007-02-20 16:19           ` Chris Mason
2007-02-20 16:08         ` Chris Mason [this message]
2007-02-20 16:29           ` Trond Myklebust
2007-02-20 16:38             ` Trond Myklebust
2007-02-20 18:40             ` Zach Brown
2007-02-21  0:05               ` Trond Myklebust
2007-02-20 14:08 ` Ananiev, Leonid I

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=20070220160854.GO6133@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=bcrl@kvack.org \
    --cc=leonid.i.ananiev@intel.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suparna@in.ibm.com \
    --cc=trond.myklebust@fys.uio.no \
    --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 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.