• Miklos Szeredi's avatar
    only allow nonlinear vmas for ram backed filesystems · 3ee6dafc
    Miklos Szeredi authored
    page_mkclean() doesn't re-protect ptes for non-linear mappings, so a later
    re-dirty through such a mapping will not generate a fault, PG_dirty will
    not reflect the dirty state and the dirty count will be skewed.  This
    implies that msync() is also currently broken for nonlinear mappings.
    
    The easiest solution is to emulate remap_file_pages on non-linear mappings
    with simple mmap() for non ram-backed filesystems.  Applications continue
    to work (albeit slower), as long as the number of remappings remain below
    the maximum vma count.
    
    However all currently known real uses of non-linear mappings are for ram
    backed filesystems, which this patch doesn't affect.
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
    Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: William Lee Irwin III <wli@holomorphy.com>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    3ee6dafc
fremap.c 5.96 KB