mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mm: thp: check pmd_trans_unstable() after split_huge_pmd()
split_huge_pmd() doesn't guarantee that the pmd is normal pmd pointing to pte entries, which can be checked with pmd_trans_unstable(). Some callers make this assertion and some do it differently and some not, so let's do it in a unified manner. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Naoya Horiguchi <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e3a2713c3c
commit
337d9abf1c
4 changed files with 6 additions and 3 deletions
2
mm/gup.c
2
mm/gup.c
|
|
@ -279,6 +279,8 @@ struct page *follow_page_mask(struct vm_area_struct *vma,
|
|||
spin_unlock(ptl);
|
||||
ret = 0;
|
||||
split_huge_pmd(vma, pmd, address);
|
||||
if (pmd_trans_unstable(pmd))
|
||||
ret = -EBUSY;
|
||||
} else {
|
||||
get_page(page);
|
||||
spin_unlock(ptl);
|
||||
|
|
|
|||
Loading…
Reference in a new issue