diff options
| -rw-r--r-- | net/tipc/group.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c index 3e8268d966fa..e5daeb093879 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c | |||
| @@ -85,7 +85,6 @@ struct tipc_group { | |||
| 85 | struct list_head small_win; | 85 | struct list_head small_win; |
| 86 | struct list_head pending; | 86 | struct list_head pending; |
| 87 | struct list_head active; | 87 | struct list_head active; |
| 88 | struct list_head reclaiming; | ||
| 89 | struct tipc_nlist dests; | 88 | struct tipc_nlist dests; |
| 90 | struct net *net; | 89 | struct net *net; |
| 91 | int subid; | 90 | int subid; |
| @@ -172,7 +171,6 @@ struct tipc_group *tipc_group_create(struct net *net, u32 portid, | |||
| 172 | INIT_LIST_HEAD(&grp->small_win); | 171 | INIT_LIST_HEAD(&grp->small_win); |
| 173 | INIT_LIST_HEAD(&grp->active); | 172 | INIT_LIST_HEAD(&grp->active); |
| 174 | INIT_LIST_HEAD(&grp->pending); | 173 | INIT_LIST_HEAD(&grp->pending); |
| 175 | INIT_LIST_HEAD(&grp->reclaiming); | ||
| 176 | grp->members = RB_ROOT; | 174 | grp->members = RB_ROOT; |
| 177 | grp->net = net; | 175 | grp->net = net; |
| 178 | grp->portid = portid; | 176 | grp->portid = portid; |
| @@ -575,7 +573,7 @@ void tipc_group_update_rcv_win(struct tipc_group *grp, int blks, u32 node, | |||
| 575 | if (!list_empty(active) && active_cnt >= reclaim_limit) { | 573 | if (!list_empty(active) && active_cnt >= reclaim_limit) { |
| 576 | rm = list_first_entry(active, struct tipc_member, list); | 574 | rm = list_first_entry(active, struct tipc_member, list); |
| 577 | rm->state = MBR_RECLAIMING; | 575 | rm->state = MBR_RECLAIMING; |
| 578 | list_move_tail(&rm->list, &grp->reclaiming); | 576 | list_del_init(&rm->list); |
| 579 | tipc_group_proto_xmit(grp, rm, GRP_RECLAIM_MSG, xmitq); | 577 | tipc_group_proto_xmit(grp, rm, GRP_RECLAIM_MSG, xmitq); |
| 580 | } | 578 | } |
| 581 | /* If max active, become pending and wait for reclaimed space */ | 579 | /* If max active, become pending and wait for reclaimed space */ |
| @@ -600,12 +598,12 @@ void tipc_group_update_rcv_win(struct tipc_group *grp, int blks, u32 node, | |||
| 600 | if (m->advertised > ADV_IDLE) | 598 | if (m->advertised > ADV_IDLE) |
| 601 | break; | 599 | break; |
| 602 | m->state = MBR_JOINED; | 600 | m->state = MBR_JOINED; |
| 601 | grp->active_cnt--; | ||
| 603 | if (m->advertised < ADV_IDLE) { | 602 | if (m->advertised < ADV_IDLE) { |
| 604 | pr_warn_ratelimited("Rcv unexpected msg after REMIT\n"); | 603 | pr_warn_ratelimited("Rcv unexpected msg after REMIT\n"); |
| 605 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); | 604 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); |
| 606 | } | 605 | } |
| 607 | grp->active_cnt--; | 606 | |
| 608 | list_del_init(&m->list); | ||
| 609 | if (list_empty(&grp->pending)) | 607 | if (list_empty(&grp->pending)) |
| 610 | return; | 608 | return; |
| 611 | 609 | ||
| @@ -761,18 +759,14 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup, | |||
| 761 | m->advertised = ADV_IDLE + in_flight; | 759 | m->advertised = ADV_IDLE + in_flight; |
| 762 | return; | 760 | return; |
| 763 | } | 761 | } |
| 764 | /* All messages preceding the REMIT have been read */ | 762 | /* This should never happen */ |
| 765 | if (m->advertised <= remitted) { | ||
| 766 | m->state = MBR_JOINED; | ||
| 767 | in_flight = 0; | ||
| 768 | } | ||
| 769 | /* ..and the REMIT overtaken by more messages => re-advertise */ | ||
| 770 | if (m->advertised < remitted) | 763 | if (m->advertised < remitted) |
| 771 | tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); | 764 | pr_warn_ratelimited("Unexpected REMIT msg\n"); |
| 772 | 765 | ||
| 773 | m->advertised = ADV_IDLE + in_flight; | 766 | /* All messages preceding the REMIT have been read */ |
| 767 | m->state = MBR_JOINED; | ||
| 774 | grp->active_cnt--; | 768 | grp->active_cnt--; |
| 775 | list_del_init(&m->list); | 769 | m->advertised = ADV_IDLE; |
| 776 | 770 | ||
| 777 | /* Set oldest pending member to active and advertise */ | 771 | /* Set oldest pending member to active and advertise */ |
| 778 | if (list_empty(&grp->pending)) | 772 | if (list_empty(&grp->pending)) |
