linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Mika Penttilä" <mika.penttila@nextfour.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, Pekka Enberg <penberg@kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH, REGRESSION v4] mm: make apply_to_page_range more robust
Date: Fri, 22 Jan 2016 13:49:58 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1601221347080.27098@chino.kir.corp.google.com> (raw)
In-Reply-To: <56A1E147.9050803@nextfour.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 753 bytes --]

On Fri, 22 Jan 2016, Mika PenttilA? wrote:

> diff --git a/mm/memory.c b/mm/memory.c
> index 30991f8..9178ee6 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1871,7 +1871,9 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
>         unsigned long end = addr + size;
>         int err;
>  
> -       BUG_ON(addr >= end);
> +       if (WARN_ON(addr >= end))
> +               return -EINVAL;
> +
>         pgd = pgd_offset(mm, addr);
>         do {
>                 next = pgd_addr_end(addr, end);

This would be fine as a second patch in a 2-patch series.  The first patch 
should fix change_memory_common() for numpages == 0 by returning without 
ever calling this function and triggering the WARN_ON().  Let's fix the 
problem.

      reply	other threads:[~2016-01-22 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-22  7:59 Mika Penttilä
2016-01-22 21:49 ` David Rientjes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1601221347080.27098@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mika.penttila@nextfour.com \
    --cc=penberg@kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox