Commit dd4c10858bb00704df476ef17a0b3037b909e4f5

Authored by Christian Borntraeger
Committed by Greg Kroah-Hartman
1 parent 74df55cf12

mm/gup: Replace ACCESS_ONCE with READ_ONCE

commit 38c5ce936a0862a6ce2c8d1c72689a3aba301425 upstream.

ACCESS_ONCE does not work reliably on non-scalar types. For
example gcc 4.6 and 4.7 might remove the volatile tag for such
accesses during the SRA (scalar replacement of aggregates) step
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145)

Fixup gup_pmd_range.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -926,7 +926,7 @@
926 926  
927 927 pmdp = pmd_offset(&pud, addr);
928 928 do {
929   - pmd_t pmd = ACCESS_ONCE(*pmdp);
  929 + pmd_t pmd = READ_ONCE(*pmdp);
930 930  
931 931 next = pmd_addr_end(addr, end);
932 932 if (pmd_none(pmd) || pmd_trans_splitting(pmd))