From 4c335a9e1a9bc0c88454e3b12e816b7e708b9bc6 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 30 Oct 2007 11:45:46 -0700 Subject: [PATCH] --- yaml --- r: 72915 b: refs/heads/master c: bdb76ef5a4bc8676a81034a443f1eda450b4babb h: refs/heads/master i: 72913: 09919c9b747169e26f5ebc92d3fbeb9a03c01991 72911: 4197d555c1db67363a03fb7138094b3a9d56a703 v: v3 --- [refs] | 2 +- trunk/mm/filemap.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 3efaa5cb0560..788ca947a835 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e58b7dab272ecee09cd7bafb89d6b224cd17bbe3 +refs/heads/master: bdb76ef5a4bc8676a81034a443f1eda450b4babb diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index 7c8643630023..9940895f734c 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -2511,21 +2511,17 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, } retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs); - if (retval) - goto out; /* * Finally, try again to invalidate clean pages which might have been - * faulted in by get_user_pages() if the source of the write was an - * mmap()ed region of the file we're writing. That's a pretty crazy - * thing to do, so we don't support it 100%. If this invalidation - * fails and we have -EIOCBQUEUED we ignore the failure. + * cached by non-direct readahead, or faulted in by get_user_pages() + * if the source of the write was an mmap'ed region of the file + * we're writing. Either one is a pretty crazy thing to do, + * so we don't support it 100%. If this invalidation + * fails, tough, the write still worked... */ if (rw == WRITE && mapping->nrpages) { - int err = invalidate_inode_pages2_range(mapping, - offset >> PAGE_CACHE_SHIFT, end); - if (err && retval >= 0) - retval = err; + invalidate_inode_pages2_range(mapping, offset >> PAGE_CACHE_SHIFT, end); } out: return retval;