• Bob Liu's avatar
    fs: ramfs: file-nommu: add SetPageUptodate() · fea9f718
    Bob Liu authored
    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
      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: 's avatarBob 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: 's avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
Last commit
Last update
Makefile Loading commit data...
file-mmu.c Loading commit data...
file-nommu.c Loading commit data...
inode.c Loading commit data...
internal.h Loading commit data...