]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: ensure that idle links are deleted when a bearer is disabled
authorJon Paul Maloy <jon.maloy@ericsson.com>
Tue, 10 Mar 2015 16:23:34 +0000 (12:23 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 10 Mar 2015 22:37:36 +0000 (18:37 -0400)
commit12ec97ba9d1aae5e04ce25ce2bb7299e608dbf78
treec4b4461c37a3657dfae2353f85e06f25333b0e3f
parenta05f0f29fc5b82281559f61ec388541fa20016c9
tipc: ensure that idle links are deleted when a bearer is disabled

commit bed219a94f6ead883b9663076f9b3e291b1e5f77
(tipc: purge links when bearer is disabled) was an attempt to resolve
a problem that turned out to have a more profound reason.

When we disable a bearer, we delete all its pertaining links if
there is no other bearer to perform failover to, or if the module
is shutting down. In case there are dual bearers, we wait with
deleting links until the failover procedure is finished.

However, this misses the case when a link on the removed bearer
was already down, so that there will be no failover procedure to
finish the link delete. This causes confusion if a new bearer is
added to replace the removed one, and also entails a small memory
leak.

This commit takes the current state of the link into account when
deciding when to delete it, and also reverses the above-mentioned
commit.

Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/bearer.c
net/tipc/link.c