Re: [PATCH 5/5] mm/sparse: return 0 if root mem_section exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat 23-06-12 23:52:56, Gavin Shan wrote:
> Function sparse_index_init() is used to setup memory section descriptors
> dynamically. zero should be returned while mem_section[root] already has
> been allocated.

Doesn't this break sparse_add_one_section which expects EEXIST?

> 
> Signed-off-by: Gavin Shan <shangw@xxxxxxxxxxxxxxxxxx>
> ---
>  mm/sparse.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/sparse.c b/mm/sparse.c
> index a8b99d3..e845a48 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -109,8 +109,12 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
>  	struct mem_section *section;
>  	int ret = 0;
>  
> +	/*
> +	 * If the corresponding mem_section descriptor
> +	 * has been created, we needn't bother
> +	 */
>  	if (mem_section[root])
> -		return -EEXIST;
> +		return ret;
>  
>  	section = sparse_index_alloc(nid);
>  	if (!section)
> -- 
> 1.7.9.5
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]