Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6870
b: refs/heads/master
c: d44ed4f
h: refs/heads/master
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Sep 5, 2005
1 parent 98690c3 commit 87f3950
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 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: 0abf40c1ac3f25d264c019e1cfe155d590defb87
refs/heads/master: d44ed4f86892e350f4b16a3489b7e7c1a9bb7ead
7 changes: 7 additions & 0 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,15 +1504,22 @@ int filemap_populate(struct vm_area_struct *vma, unsigned long addr,
return -EINVAL;

page = filemap_getpage(file, pgoff, nonblock);

/* XXX: This is wrong, a filesystem I/O error may have happened. Fix that as
* done in shmem_populate calling shmem_getpage */
if (!page && !nonblock)
return -ENOMEM;

if (page) {
err = install_page(mm, vma, addr, page, prot);
if (err) {
page_cache_release(page);
return err;
}
} else {
/* No page was found just because we can't read it in now (being
* here implies nonblock != 0), but the page may exist, so set
* the PTE to fault it in later. */
err = install_file_pte(mm, vma, addr, pgoff, prot);
if (err)
return err;
Expand Down
6 changes: 5 additions & 1 deletion trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,14 +1195,18 @@ static int shmem_populate(struct vm_area_struct *vma,
err = shmem_getpage(inode, pgoff, &page, sgp, NULL);
if (err)
return err;
/* Page may still be null, but only if nonblock was set. */
if (page) {
mark_page_accessed(page);
err = install_page(mm, vma, addr, page, prot);
if (err) {
page_cache_release(page);
return err;
}
} else if (nonblock) {
} else {
/* No page was found just because we can't read it in
* now (being here implies nonblock != 0), but the page
* may exist, so set the PTE to fault it in later. */
err = install_file_pte(mm, vma, addr, pgoff, prot);
if (err)
return err;
Expand Down

0 comments on commit 87f3950

Please sign in to comment.