aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-12-18 12:13:34 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-18 13:16:40 -0500
commit3f42f5fe31c8715a34064bfd7b788488d1ea2f7c (patch)
treebb6f596e37ae0cd2f972a9ef3b710d46a441b4c2 /net/tipc
parent234833991e14681f61cbfd93e65a5c976089cf11 (diff)
tipc: remove leaving group member from all lists
A group member going into state LEAVING should never go back to any other state before it is finally deleted. However, this might happen if the socket needs to send out a RECLAIM message during this interval. Since we forget to remove the leaving member from the group's 'active' or 'pending' list, the member might be selected for reclaiming, change state to RECLAIMING, and get stuck in this state instead of being deleted. This might lead to suppression of the expected 'member down' event to the receiver. We fix this by removing the member from all lists, except the RB tree, at the moment it goes into state LEAVING. 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/group.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c
index efb5714e7a85..b96ec429bb9b 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -699,6 +699,9 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
699 if (!m) 699 if (!m)
700 return; 700 return;
701 m->bc_syncpt = msg_grp_bc_syncpt(hdr); 701 m->bc_syncpt = msg_grp_bc_syncpt(hdr);
702 list_del_init(&m->list);
703 list_del_init(&m->congested);
704 *usr_wakeup = true;
702 705
703 /* Wait until WITHDRAW event is received */ 706 /* Wait until WITHDRAW event is received */
704 if (m->state != MBR_LEAVING) { 707 if (m->state != MBR_LEAVING) {
@@ -710,8 +713,6 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
710 ehdr = buf_msg(m->event_msg); 713 ehdr = buf_msg(m->event_msg);
711 msg_set_grp_bc_seqno(ehdr, m->bc_syncpt); 714 msg_set_grp_bc_seqno(ehdr, m->bc_syncpt);
712 __skb_queue_tail(inputq, m->event_msg); 715 __skb_queue_tail(inputq, m->event_msg);
713 *usr_wakeup = true;
714 list_del_init(&m->congested);
715 return; 716 return;
716 case GRP_ADV_MSG: 717 case GRP_ADV_MSG:
717 if (!m) 718 if (!m)
@@ -863,6 +864,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
863 msg_set_grp_bc_seqno(hdr, m->bc_rcv_nxt); 864 msg_set_grp_bc_seqno(hdr, m->bc_rcv_nxt);
864 __skb_queue_tail(inputq, skb); 865 __skb_queue_tail(inputq, skb);
865 } 866 }
867 list_del_init(&m->list);
866 list_del_init(&m->congested); 868 list_del_init(&m->congested);
867 } 869 }
868 *sk_rcvbuf = tipc_group_rcvbuf_limit(grp); 870 *sk_rcvbuf = tipc_group_rcvbuf_limit(grp);