On Mon, 3 Apr 2017, Michal Hocko wrote: > On Fri 31-03-17 20:58:16, Ben Hutchings wrote: > > On Tue, 2017-03-28 at 15:11 +0200, Michal Hocko wrote: > > > 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. > > > > Thanks for reporting this. This is the same mistake I made initially > > with follow_page() in 3.2. But I had a test case which caught that > > before release, and I don't have a test case for this. > > I believe Miroslav has used the test case embeded in the patch > description to catch the bug. That is correct. Miroslav