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

From: Sergey Senozhatsky
Date: Fri May 05 2023 - 22:47:23 EST


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.