diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -204,7 +204,7 @@ struct anon_vma *page_lock_anon_vma(struct page *page) | |||
204 | unsigned long anon_mapping; | 204 | unsigned long anon_mapping; |
205 | 205 | ||
206 | rcu_read_lock(); | 206 | rcu_read_lock(); |
207 | anon_mapping = (unsigned long) page->mapping; | 207 | anon_mapping = (unsigned long) ACCESS_ONCE(page->mapping); |
208 | if ((anon_mapping & PAGE_MAPPING_FLAGS) != PAGE_MAPPING_ANON) | 208 | if ((anon_mapping & PAGE_MAPPING_FLAGS) != PAGE_MAPPING_ANON) |
209 | goto out; | 209 | goto out; |
210 | if (!page_mapped(page)) | 210 | if (!page_mapped(page)) |
@@ -666,7 +666,9 @@ static void __page_check_anon_rmap(struct page *page, | |||
666 | * @address: the user virtual address mapped | 666 | * @address: the user virtual address mapped |
667 | * | 667 | * |
668 | * The caller needs to hold the pte lock, and the page must be locked in | 668 | * The caller needs to hold the pte lock, and the page must be locked in |
669 | * the anon_vma case: to serialize mapping,index checking after setting. | 669 | * the anon_vma case: to serialize mapping,index checking after setting, |
670 | * and to ensure that PageAnon is not being upgraded racily to PageKsm | ||
671 | * (but PageKsm is never downgraded to PageAnon). | ||
670 | */ | 672 | */ |
671 | void page_add_anon_rmap(struct page *page, | 673 | void page_add_anon_rmap(struct page *page, |
672 | struct vm_area_struct *vma, unsigned long address) | 674 | struct vm_area_struct *vma, unsigned long address) |