linux-sg2042/fs/ramfs
Bob Liu fea9f718b3 fs: ramfs: file-nommu: add SetPageUptodate()
There is a bug in the below scenario for !CONFIG_MMU:

 1. create a new file
 2. mmap the file and write to it
 3. read the file can't get the correct value

Because

  sys_read() -> generic_file_aio_read() -> simple_readpage() -> clear_page()

which causes the page to be zeroed.

Add SetPageUptodate() to ramfs_nommu_expand_for_mapping() so that
generic_file_aio_read() do not call simple_readpage().

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@uclinux.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-07-11 16:04:47 -07:00
..
Makefile Remove valueless definition of hard-selected RAMFS option 2007-10-17 08:42:56 -07:00
file-mmu.c fs: convert simple fs to new truncate 2010-05-27 22:15:47 -04:00
file-nommu.c fs: ramfs: file-nommu: add SetPageUptodate() 2012-07-11 16:04:47 -07:00
inode.c tidy up after d_make_root() conversion 2012-03-20 21:29:37 -04:00
internal.h fs/ramfs/ extern cleanup 2008-04-29 08:06:00 -07:00