diff options
author | Erik Hugne <erik.hugne@gmail.com> | 2016-04-07 10:40:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-11 15:22:20 -0400 |
commit | ddb1d33969ef52687ad00f75eecf87029f62e382 (patch) | |
tree | 6863f3e9a8ef3b08c199ddf13481ce967ff5c448 /net/tipc | |
parent | 541726abe7daca64390c2ec34e6a203145f1686d (diff) |
tipc: purge deferred updates from dead nodes
If a peer node becomes unavailable, in addition to removing the
nametable entries from this node we also need to purge all deferred
updates associated with this node.
Signed-off-by: Erik Hugne <erik.hugne@gmail.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/name_distr.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index 4f4f5810f223..6b626a64b517 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c | |||
@@ -224,12 +224,31 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr) | |||
224 | kfree_rcu(p, rcu); | 224 | kfree_rcu(p, rcu); |
225 | } | 225 | } |
226 | 226 | ||
227 | /** | ||
228 | * tipc_dist_queue_purge - remove deferred updates from a node that went down | ||
229 | */ | ||
230 | static void tipc_dist_queue_purge(struct net *net, u32 addr) | ||
231 | { | ||
232 | struct tipc_net *tn = net_generic(net, tipc_net_id); | ||
233 | struct distr_queue_item *e, *tmp; | ||
234 | |||
235 | spin_lock_bh(&tn->nametbl_lock); | ||
236 | list_for_each_entry_safe(e, tmp, &tn->dist_queue, next) { | ||
237 | if (e->node != addr) | ||
238 | continue; | ||
239 | list_del(&e->next); | ||
240 | kfree(e); | ||
241 | } | ||
242 | spin_unlock_bh(&tn->nametbl_lock); | ||
243 | } | ||
244 | |||
227 | void tipc_publ_notify(struct net *net, struct list_head *nsub_list, u32 addr) | 245 | void tipc_publ_notify(struct net *net, struct list_head *nsub_list, u32 addr) |
228 | { | 246 | { |
229 | struct publication *publ, *tmp; | 247 | struct publication *publ, *tmp; |
230 | 248 | ||
231 | list_for_each_entry_safe(publ, tmp, nsub_list, nodesub_list) | 249 | list_for_each_entry_safe(publ, tmp, nsub_list, nodesub_list) |
232 | tipc_publ_purge(net, publ, addr); | 250 | tipc_publ_purge(net, publ, addr); |
251 | tipc_dist_queue_purge(net, addr); | ||
233 | } | 252 | } |
234 | 253 | ||
235 | /** | 254 | /** |