From: Mel Gorman <mgorman@suse.de>
Subject: [PATCH] netvm: Remove duplicated initialization in net/ipv4/route.c.
Patch-mainline: Not yet
References: bnc#678970

Calling mem_reserve_init() twice causes list_add corruption error and
unnecessarily increases reserves. Remove one initialisation.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
---
 net/ipv4/route.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

Index: linux-2.6.37-openSUSE-11.4/net/ipv4/route.c
===================================================================
--- linux-2.6.37-openSUSE-11.4.orig/net/ipv4/route.c
+++ linux-2.6.37-openSUSE-11.4/net/ipv4/route.c
@@ -224,7 +224,6 @@ struct rt_hash_bucket {
 #  define RT_HASH_LOCK_SZ	256
 # endif
 #endif
-#include <linux/reserve.h>
 
 static spinlock_t	*rt_hash_locks;
 # define rt_hash_lock_addr(slot) &rt_hash_locks[(slot) & (RT_HASH_LOCK_SZ - 1)]
@@ -271,8 +270,6 @@ static inline int rt_genid(struct net *n
 
 static struct mem_reserve ipv4_route_reserve;
 
-static struct mem_reserve ipv4_route_reserve;
-
 #ifdef CONFIG_PROC_FS
 struct rt_cache_iter_state {
 	struct seq_net_private p;
@@ -431,8 +428,6 @@ proc_dointvec_route(struct ctl_table *ta
 	return ret;
 }
 
-static struct mutex ipv4_route_lock;
-
 static const struct seq_operations rt_cache_seq_ops = {
 	.start  = rt_cache_seq_start,
 	.next   = rt_cache_seq_next,
@@ -3167,7 +3162,7 @@ static ctl_table ipv4_route_table[] = {
 		.data		= &ip_rt_redirect_load,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
-		.proc_handler	= proc_dointvec_route,
+		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "redirect_number",
@@ -3369,15 +3364,6 @@ int __init ip_rt_init(void)
 
 #ifdef CONFIG_PROCFS
 	mutex_init(&ipv4_route_lock);
-#endif
-
-	mem_reserve_init(&ipv4_route_reserve, "IPv4 route cache",
-			&net_rx_reserve);
-	mem_reserve_kmem_cache_set(&ipv4_route_reserve,
-			ipv4_dst_ops.kmem_cachep, ip_rt_max_size);
-
-#ifdef CONFIG_PROCFS
-	mutex_init(&ipv4_route_lock);
 #endif
 
 	mem_reserve_init(&ipv4_route_reserve, "IPv4 route cache",
