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, 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?




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux