[Devel] [PATCH rh7] net/fib: drop leftovers from per-ve_struct fib tables

Konstantin Khorenko khorenko at virtuozzo.com
Mon Dec 18 18:54:16 MSK 2017


There was a patch in 2.6.18-x: diff-ve-net-ipv6-comp-fix-20061220
which made per-ve_struct fib tables working, in particular
it introduced fib6_unlink_table() which managed tb->tb6_hlist
and thus required tb->tb6_lock there and in fib6_link_table().

This patch does not exist in 3.10.0-x =>
no need for a lock in fib6_link_table() either, drop it.

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 net/ipv6/ip6_fib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index aa55469..a5fa8e5 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -198,9 +198,11 @@ static void fib6_link_table(struct net *net, struct fib6_table *tb)
 
 	h = tb->tb6_id & (FIB6_TABLE_HASHSZ - 1);
 
-	write_lock_bh(&tb->tb6_lock);
+	/*
+	 * No protection necessary, this is the only list mutatation
+	 * operation, tables never disappear once they exist.
+	 */
 	hlist_add_head_rcu(&tb->tb6_hlist, &net->ipv6.fib_table_hash[h]);
-	write_unlock_bh(&tb->tb6_lock);
 }
 
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
-- 
2.1.4



More information about the Devel mailing list