diff options
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.patch | 49 |
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 @@ | |||
1 | From e3b50d463ce69af9fb5b2d4a54e6c37637c2ecef Mon Sep 17 00:00:00 2001 | ||
2 | From: Bob Liu <lliubbo@gmail.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:35 -0700 | ||
4 | Subject: [PATCH 042/109] fs: ramfs: file-nommu: add SetPageUptodate() | ||
5 | |||
6 | commit fea9f718b3d68147f162ed2d870183ce5e0ad8d8 upstream. | ||
7 | |||
8 | There 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 | |||
14 | Because | ||
15 | |||
16 | sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page() | ||
17 | |||
18 | which causes the page to be zeroed. | ||
19 | |||
20 | Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that | ||
21 | generic_file_aio_read() do not call simple_readpage(). | ||
22 | |||
23 | Signed-off-by: Bob Liu <lliubbo@gmail.com> | ||
24 | Cc: Hugh Dickins <hughd@google.com> | ||
25 | Cc: David Howells <dhowells@redhat.com> | ||
26 | Cc: Geert Uytterhoeven <geert@linux-m68k.org> | ||
27 | Cc: Greg Ungerer <gerg@uclinux.org> | ||
28 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
29 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
30 | Signed-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 | |||
35 | diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c | ||
36 | index 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 | -- | ||
48 | 1.7.7.6 | ||
49 | |||