[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100906093610.C8B5.A69D9226@jp.fujitsu.com>
Date: Mon, 6 Sep 2010 09:41:28 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Kulikov Vasiliy <segooon@...il.com>
Cc: kosaki.motohiro@...fujitsu.com, kernel-janitors@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Lee Schermerhorn <lee.schermerhorn@...com>,
Christoph Lameter <cl@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 13/14] mm: mempolicy: Check return code of check_range
> From: Vasiliy Kulikov <segooon@...il.com>
>
> Function check_range may return ERR_PTR(...). Check for it.
When happen this issue?
afaik, check_range return error when following condition.
1) mm->mmap->vm_start argument is incorrect
2) don't have neigher MPOL_MF_STATS, MPOL_MF_MOVE and MPOL_MF_MOVE_ALL
I think both case is not happen in real. Am I overlooking anything?
>
> Signed-off-by: Vasiliy Kulikov <segooon@...il.com>
> ---
> Compile tested.
>
> mm/mempolicy.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index f969da5..b73f02c 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -924,12 +924,15 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
> nodemask_t nmask;
> LIST_HEAD(pagelist);
> int err = 0;
> + struct vm_area_struct *vma;
>
> nodes_clear(nmask);
> node_set(source, nmask);
>
> - check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
> + vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
> flags | MPOL_MF_DISCONTIG_OK, &pagelist);
> + if (IS_ERR(vma))
> + return PTR_ERR(vma);
>
> if (!list_empty(&pagelist))
> err = migrate_pages(&pagelist, new_node_page, dest, 0);
> --
> 1.7.0.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists