tipc: adjust locking policy of subscription
authorYing Xue <ying.xue@windriver.com>
Mon, 4 May 2015 02:36:47 +0000 (10:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2015 19:04:01 +0000 (15:04 -0400)
commita13683f292b2ce697f71fa3788a9335ebcb32676
tree09672fe29b03cd8e43e8017089bb89beb6ef45a8
parent00bc00a9384c306cdd48611a53b955d936349bf6
tipc: adjust locking policy of subscription

Currently subscriber's lock protects not only subscriber's subscription
list but also all subscriptions linked into the list. However, as all
members of subscription are never changed after they are initialized,
it's unnecessary for subscription to be protected under subscriber's
lock. If the lock is used to only protect subscriber's subscription
list, the adjustment not only makes the locking policy simpler, but
also helps to avoid a deadlock which may happen once creating a
subscription is failed.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/subscr.c