Re: [PATCH mmotm] mempolicy: mbind_range() set_policy() after vma_merge()

From: Oleg Nesterov
Date: Fri Mar 04 2022 - 13:06:48 EST


On 03/03, Hugh Dickins wrote:
>
> Just delete that optimization now (though it could be made conditional
> on vma not having a set_policy). Also remove the "next" variable:
> it turned out to be blameless, but also pointless.
>
> Fixes: 3964acd0dbec ("mm: mempolicy: fix mbind_range() && vma_adjust() interaction")

I can't believe I ever looked at this code ;)

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>


offtopic question... can't vma_replace_policy() check vm_ops && vm_ops->set_policy
at the start, before mpol_dup() ?

Oleg.