The patch titled
shmem_populate: avoid an useless check, and some comments
has been added to the -mm tree. Its filename is
shmem_populate-avoid-an-useless-check-and-some-comments.patch
Patches currently in -mm which might be from [EMAIL PROTECTED] are
comment-typo-fix.patch
shmem_populate-avoid-an-useless-check-and-some-comments.patch
x86_64-remove-duplicated-sys_time64.patch
uml-rename-kconfig-files-to-be-like-the-other-arches.patch
ptrace-i386-fix-syscall-audit-interaction-with-singlestep.patch
uml-support-ptrace-adds-the-host-sysemu-support-for-uml-and-general-usage.patch
uml-support-reorganize-ptrace_sysemu-support.patch
uml-support-add-ptrace_sysemu_singlestep-option-to-i386.patch
sysemu-fix-sysaudit--singlestep-interaction.patch
uml-support-sysemu-slight-cleanup-and-speedup.patch
uml-workaround-gdb-problems-on-debugging.patch
uml-fix-sigwinch-handler-race-while-waiting-for-signals.patch
uml-fixes-performance-regression-in-activate_mm-and-thus-exec.patch
From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
Either shmem_getpage returns a failure, or it found a page, or it was told
it couldn't do any I/O. So it's useless to check nonblock in the else
branch. We could add a BUG() there but I preferred to comment the
offending function.
This was taken out from one Ingo Molnar's old patch I'm resurrecting.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
Cc: Ingo Molnar <[EMAIL PROTECTED]>
Cc: Hugh Dickins <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
mm/filemap.c | 7 +++++++
mm/shmem.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff -puN mm/filemap.c~shmem_populate-avoid-an-useless-check-and-some-comments
mm/filemap.c
--- 25/mm/filemap.c~shmem_populate-avoid-an-useless-check-and-some-comments
Wed Aug 17 14:47:16 2005
+++ 25-akpm/mm/filemap.c Wed Aug 17 14:47:16 2005
@@ -1504,8 +1504,12 @@ repeat:
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) {
@@ -1513,6 +1517,9 @@ repeat:
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;
diff -puN mm/shmem.c~shmem_populate-avoid-an-useless-check-and-some-comments
mm/shmem.c
--- 25/mm/shmem.c~shmem_populate-avoid-an-useless-check-and-some-comments
Wed Aug 17 14:47:16 2005
+++ 25-akpm/mm/shmem.c Wed Aug 17 14:47:16 2005
@@ -1196,6 +1196,7 @@ static int shmem_populate(struct vm_area
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);
@@ -1203,7 +1204,10 @@ static int shmem_populate(struct vm_area
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;
_
-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html