]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: advance the time of deleting subscription from subscriber->subscrp_list
authorYing Xue <ying.xue@windriver.com>
Tue, 28 Mar 2017 10:28:27 +0000 (12:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 01:03:32 +0000 (18:03 -0700)
commit4731f1c36897a9919e1651c5742847d40c87834a
tree67aaf23ea8b620ffeba8fd79273d480811b8cf5c
parent877415a5731f878b9a55e7741be71e8bdfcc5e6b
tipc: advance the time of deleting subscription from subscriber->subscrp_list

After a subscription object is created, it's inserted into its
subscriber subscrp_list list under subscriber lock protection,
similarly, before it's destroyed, it should be first removed from
its subscriber->subscrp_list. Since the subscription list is
accessed with subscriber lock, all the subscriptions are valid
during the lock duration. Hence in tipc_subscrb_subscrp_delete(), we
remove subscription get/put and the extra subscriber unlock/lock.

After this change, the subscriptions refcount cleanup is very simple
and does not access any lock.

Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/subscr.c