Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109404
b: refs/heads/master
c: 6ccfa80
h: refs/heads/master
v: v3
  • Loading branch information
Hisashi Hifumi authored and Linus Torvalds committed Sep 3, 2008
1 parent 9ee5009 commit 82f3217
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 344c790e3821dac37eb742ddd0b611a300f78b9a
refs/heads/master: 6ccfa806a9cfbbf1cd43d5b6aa47ef2c0eb518fd
11 changes: 9 additions & 2 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2129,13 +2129,20 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
* After a write we want buffered reads to be sure to go to disk to get
* the new data. We invalidate clean cached page from the region we're
* about to write. We do this *before* the write so that we can return
* -EIO without clobbering -EIOCBQUEUED from ->direct_IO().
* without clobbering -EIOCBQUEUED from ->direct_IO().
*/
if (mapping->nrpages) {
written = invalidate_inode_pages2_range(mapping,
pos >> PAGE_CACHE_SHIFT, end);
if (written)
/*
* If a page can not be invalidated, return 0 to fall back
* to buffered write.
*/
if (written) {
if (written == -EBUSY)
return 0;
goto out;
}
}

written = mapping->a_ops->direct_IO(WRITE, iocb, iov, pos, *nr_segs);
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static int do_launder_page(struct address_space *mapping, struct page *page)
* Any pages which are found to be mapped into pagetables are unmapped prior to
* invalidation.
*
* Returns -EIO if any pages could not be invalidated.
* Returns -EBUSY if any pages could not be invalidated.
*/
int invalidate_inode_pages2_range(struct address_space *mapping,
pgoff_t start, pgoff_t end)
Expand Down Expand Up @@ -440,7 +440,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
ret2 = do_launder_page(mapping, page);
if (ret2 == 0) {
if (!invalidate_complete_page2(mapping, page))
ret2 = -EIO;
ret2 = -EBUSY;
}
if (ret2 < 0)
ret = ret2;
Expand Down

0 comments on commit 82f3217

Please sign in to comment.