On Wed 22-03-17 10:09:43, Jiri Slaby wrote: [...] > @@ -1245,6 +1254,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma, > > page = pmd_page(*pmd); > VM_BUG_ON(!PageHead(page)); > + > + if (flags & FOLL_WRITE && !can_follow_write_pmd(*pmd, page, flags)) > + goto out; > + > if (flags & FOLL_TOUCH) { > pmd_t _pmd; > /* I have just noticed that this patch is not correct fo 3.12 because we should return NULL rather than the page in this case. 3.2 is wrong as well AFAICS. -- Michal Hocko SUSE Labs