summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch
new file mode 100644
index 00000000..89f0feac
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0042-fs-ramfs-file-nommu-add-SetPageUptodate.patch
@@ -0,0 +1,49 @@
1From e3b50d463ce69af9fb5b2d4a54e6c37637c2ecef Mon Sep 17 00:00:00 2001
2From: Bob Liu <lliubbo@gmail.com>
3Date: Wed, 11 Jul 2012 14:02:35 -0700
4Subject: [PATCH 042/109] fs: ramfs: file-nommu: add SetPageUptodate()
5
6commit fea9f718b3d68147f162ed2d870183ce5e0ad8d8 upstream.
7
8There is a bug in the below scenario for !CONFIG_MMU:
9
10 1. create a new file
11 2. mmap the file and write to it
12 3. read the file can't get the correct value
13
14Because
15
16 sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()
17
18which causes the page to be zeroed.
19
20Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
21generic_file_aio_read() do not call simple_readpage().
22
23Signed-off-by: Bob Liu <lliubbo@gmail.com>
24Cc: Hugh Dickins <hughd@google.com>
25Cc: David Howells <dhowells@redhat.com>
26Cc: Geert Uytterhoeven <geert@linux-m68k.org>
27Cc: Greg Ungerer <gerg@uclinux.org>
28Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
29Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
30Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
31---
32 fs/ramfs/file-nommu.c | 1 +
33 1 files changed, 1 insertions(+), 0 deletions(-)
34
35diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
36index fbb0b47..d5378d0 100644
37--- a/fs/ramfs/file-nommu.c
38+++ b/fs/ramfs/file-nommu.c
39@@ -110,6 +110,7 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize)
40
41 /* prevent the page from being discarded on memory pressure */
42 SetPageDirty(page);
43+ SetPageUptodate(page);
44
45 unlock_page(page);
46 put_page(page);
47--
481.7.7.6
49