Re: [PATCH 2/2] mm/khugepaged: Fix a NULL vs IS_ERR() bug in collapse_pte_mapped_thp()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 20, 2023 at 09:49:15AM -0700, Vishal Moola wrote:
> On Fri, Oct 20, 2023 at 9:36 AM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Fri, 20 Oct 2023 17:14:36 +0300 Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> >
> > > This was changed from find_lock_page() which returns NULL to
> > > filemap_lock_folio() which returns error pointers.  Update the
> > > error checking to match.
> > >
> > > --- a/mm/khugepaged.c
> > > +++ b/mm/khugepaged.c
> > > @@ -1508,7 +1508,7 @@ int collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr,
> > >
> > >       folio = filemap_lock_folio(vma->vm_file->f_mapping,
> > >                              linear_page_index(vma, haddr));
> > > -     if (!folio)
> > > +     if (IS_ERR(folio))
> > >               return SCAN_PAGE_NULL;
> > >
> > >       if (folio_order(folio) != HPAGE_PMD_ORDER) {
> >
> > Also doesn't appear applicable to current kernels?
> 
> Thanks for these. Both these fix patches address issues introduced by my
> khugepaged folio conversion patchset:
> https://lore.kernel.org/linux-mm/20231018203213.50224-1-vishal.moola@xxxxxxxxx/T/#t
> 
> Andrew already dropped the patchset from current kernels so I can fix a
> couple issues, v3 will include all these fixes.


Only this one was introduced by your patchset.  The other bug is older.
I don't know why it only showed up as a new bug now.  I had guessed that
it was other changes I had made to Smatch which affected this.

regards,
dan carpenter




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux