diff options
author | Andrea Arcangeli <aarcange@redhat.com> | 2016-10-07 20:01:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 21:46:29 -0400 |
commit | 6d2329f8872f23e46a19d240930571510ce525eb (patch) | |
tree | 598cc5a8d764aa497570b359fc1328be5fa105cc /mm/migrate.c | |
parent | 6213055f2c068b63078649457391ecea9b489ea3 (diff) |
mm: vm_page_prot: update with WRITE_ONCE/READ_ONCE
vma->vm_page_prot is read lockless from the rmap_walk, it may be updated
concurrently and this prevents the risk of reading intermediate values.
Link: http://lkml.kernel.org/r/1474660305-19222-1-git-send-email-aarcange@redhat.com
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Jan Vorlicek <janvorli@microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index f7ee04a5ae27..99250aee1ac1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -234,7 +234,7 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma, | |||
234 | goto unlock; | 234 | goto unlock; |
235 | 235 | ||
236 | get_page(new); | 236 | get_page(new); |
237 | pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); | 237 | pte = pte_mkold(mk_pte(new, READ_ONCE(vma->vm_page_prot))); |
238 | if (pte_swp_soft_dirty(*ptep)) | 238 | if (pte_swp_soft_dirty(*ptep)) |
239 | pte = pte_mksoft_dirty(pte); | 239 | pte = pte_mksoft_dirty(pte); |
240 | 240 | ||