Re: [PATCH v4 4/5] mm: Use is_cow_mapping() across tree where proper

From: Jason Gunthorpe
Date: Tue Feb 09 2021 - 13:14:26 EST


On Mon, Feb 08, 2021 at 10:02:28PM -0500, Peter Xu wrote:
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 71ccec5c3817..620700f05ff4 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3733,15 +3733,13 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
> pte_t *src_pte, *dst_pte, entry, dst_entry;
> struct page *ptepage;
> unsigned long addr;
> - int cow;
> + int cow = is_cow_mapping(vma->vm_flags);

int should be bool

Otherwise looks fine to me

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Jason