[PATCH v2 18/36] mm: Update vma_iter_store() to use MAS_WARN_ON()

Sergey Senozhatsky senozhatsky at chromium.org
Fri May 5 19:47:13 PDT 2023


On (23/05/05 13:41), Liam R. Howlett wrote:
>  #if defined(CONFIG_DEBUG_VM_MAPLE_TREE)
> -	if (WARN_ON(vmi->mas.node != MAS_START && vmi->mas.index > vma->vm_start)) {
> -		printk("%lu > %lu\n", vmi->mas.index, vma->vm_start);
> -		printk("store of vma %lu-%lu", vma->vm_start, vma->vm_end);
> -		printk("into slot    %lu-%lu", vmi->mas.index, vmi->mas.last);
> -		vma_iter_dump_tree(vmi);
> +	if (MAS_WARN_ON(&vmi->mas, vmi->mas.node != MAS_START &&
> +			vmi->mas.index > vma->vm_start)) {
> +		pr_warn("%lx > %lx\n"
> +		       "store of vma %lx-%lx\n"
> +		       "into slot    %lx-%lx\n",

A minor side note: we usually prefer to avoid breaking printk() format
strings because it makes grep-ing difficult. But in this particular case
it's fine, since all the format sub-strings end with a new line character.



More information about the maple-tree mailing list