if ((old_addr & ~HPAGE_PMD_MASK) ||
(new_addr & ~HPAGE_PMD_MASK) ||
(old_addr + HPAGE_PMD_SIZE) > old_end ||
- new_vma->vm_flags & VM_NOHUGEPAGE)
+ (new_vma->vm_flags & VM_NOHUGEPAGE))
goto out;
/*
* The destination pmd shouldn't be established, free_pgtables()
* should have release it.
*/
- if (!pmd_none(*new_pmd)) {
- WARN_ON(1);
+ if (!WARN_ON(pmd_none(*new_pmd))) {
VM_BUG_ON(pmd_trans_huge(*new_pmd));
goto out;
}
spin_unlock(&mm->page_table_lock);
ret = 1;
}
- } else
+ } else {
spin_unlock(&mm->page_table_lock);
-
+ }
out:
return ret;
}
if (err > 0) {
need_flush = true;
continue;
- } else if (!err)
+ } else if (!err) {
split_huge_page_pmd(vma->vm_mm, old_pmd);
+ }
VM_BUG_ON(pmd_trans_huge(*old_pmd));
}
if (pmd_none(*new_pmd) && __pte_alloc(new_vma->vm_mm, new_vma,
- new_pmd,
- new_addr))
+ new_pmd, new_addr))
break;
next = (new_addr + PMD_SIZE) & PMD_MASK;
if (extent > next - new_addr)