diff options
-rw-r--r-- | include/asm-generic/pgtable.h | 3 | ||||
-rw-r--r-- | mm/msync.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 1f4ec7b70270..f40593565173 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -125,6 +125,9 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
125 | 125 | ||
126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY | 126 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY |
127 | #define page_test_and_clear_dirty(page) (0) | 127 | #define page_test_and_clear_dirty(page) (0) |
128 | #define pte_maybe_dirty(pte) pte_dirty(pte) | ||
129 | #else | ||
130 | #define pte_maybe_dirty(pte) (1) | ||
128 | #endif | 131 | #endif |
129 | 132 | ||
130 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG | 133 | #ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG |
diff --git a/mm/msync.c b/mm/msync.c index 090f426bca7d..d0f5a1bce7cb 100644 --- a/mm/msync.c +++ b/mm/msync.c | |||
@@ -34,6 +34,8 @@ static void sync_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
34 | 34 | ||
35 | if (!pte_present(*pte)) | 35 | if (!pte_present(*pte)) |
36 | continue; | 36 | continue; |
37 | if (!pte_maybe_dirty(*pte)) | ||
38 | continue; | ||
37 | pfn = pte_pfn(*pte); | 39 | pfn = pte_pfn(*pte); |
38 | if (!pfn_valid(pfn)) | 40 | if (!pfn_valid(pfn)) |
39 | continue; | 41 | continue; |