lkml.org 
[lkml]   [2014]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v11 07/21] dax,ext2: Replace XIP read and write with DAX I/O
On Thu, Oct 16, 2014 at 03:51:12PM -0400, Matthew Wilcox wrote:
> On Thu, Oct 16, 2014 at 11:50:27AM +0200, Mathieu Desnoyers wrote:
> > > + if (rw == WRITE) {
> > > + if (!buffer_mapped(bh)) {
> > > + retval = -EIO;
> > > + /* FIXME: fall back to buffered I/O */
> >
> > Fallback on buffered I/O would void guarantee about having data stored
> > into persistent memory after write returns. Not sure we actually want
> > that.
>
> Yeah, I think that comment is just stale. I can't see a way in which
> buffered I/O would succeed after DAX I/O falis.

On further consideration, I think the whole thing is just foolish.
I don't see how get_block(create == 1) can return success *and* a buffer
that is !mapped.

So I did this nice simplification:

- if (rw == WRITE) {
- if (!buffer_mapped(bh)) {
- retval = -EIO;
- /* FIXME: fall back to buffered I/O */
- break;
- }
- hole = false;
- } else {
- hole = !buffer_written(bh);
- }
+ hole = (rw != WRITE) && !buffer_written(bh);

(compile-tested only; I'm going to run all the changes through xfstests
next week when I'm back home before sending out a v12).


\
 
 \ /
  Last update: 2014-10-17 09:42    [W:1.350 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site