linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Liam Howlett <liam.howlett@oracle.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] remap_file_pages: Use vma_lookup() instead of find_vma()
Date: Tue, 17 Aug 2021 16:03:32 +0200	[thread overview]
Message-ID: <6c7e2274-98d7-721b-498b-6c5fac2a3561@redhat.com> (raw)
In-Reply-To: <20210817135234.1550204-1-Liam.Howlett@oracle.com>

On 17.08.21 15:52, Liam Howlett wrote:
> From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
> 
> Using vma_lookup() verifies the start address is contained in the found vma.
> This results in easier to read code.
> 
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
> ---
>   mm/mmap.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/mmap.c b/mm/mmap.c
> index d9aa54be6244..1a23d4575cc4 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2994,14 +2994,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
>   	if (mmap_write_lock_killable(mm))
>   		return -EINTR;
>   
> -	vma = find_vma(mm, start);
> +	vma = vma_lookup(mm, start);
>   
>   	if (!vma || !(vma->vm_flags & VM_SHARED))
>   		goto out;
>   
> -	if (start < vma->vm_start)
> -		goto out;
> -
>   	if (start + size > vma->vm_end) {
>   		struct vm_area_struct *next;
>   
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2021-08-17 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 13:52 [PATCH] remap_file_pages: Use vma_lookup() instead of find_vma() Liam Howlett
2021-08-17 14:03 ` David Hildenbrand [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=6c7e2274-98d7-721b-498b-6c5fac2a3561@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).