Skip to content

Commit e6441ba

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: fix bug in link failover handling
In commit c637c10 ("tipc: resolve race problem at unicast message reception") we introduced a new mechanism for delivering buffers upwards from link to socket layer. That code contains a bug in how we handle the new link input queue during failover. When a link is reset, some of its users may be blocked because of congestion, and in order to resolve this, we add any pending wakeup pseudo messages to the link's input queue, and deliver them to the socket. This misses the case where the other, remaining link also may have congested users. Currently, the owner node's reference to the remaining link's input queue is unconditionally overwritten by the reset link's input queue. This has the effect that wakeup events from the remaining link may be unduely delayed (but not lost) for a potentially long period. We fix this by adding the pending events from the reset link to the input queue that is currently referenced by the node, whichever one it is. This commit should be applied to both net and net-next. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 82f1709 commit e6441ba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/tipc/link.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,11 @@ void tipc_link_reset(struct tipc_link *l_ptr)
464464
/* Clean up all queues, except inputq: */
465465
__skb_queue_purge(&l_ptr->outqueue);
466466
__skb_queue_purge(&l_ptr->deferred_queue);
467-
skb_queue_splice_init(&l_ptr->wakeupq, &l_ptr->inputq);
468-
if (!skb_queue_empty(&l_ptr->inputq))
467+
if (!owner->inputq)
468+
owner->inputq = &l_ptr->inputq;
469+
skb_queue_splice_init(&l_ptr->wakeupq, owner->inputq);
470+
if (!skb_queue_empty(owner->inputq))
469471
owner->action_flags |= TIPC_MSG_EVT;
470-
owner->inputq = &l_ptr->inputq;
471472
l_ptr->next_out = NULL;
472473
l_ptr->unacked_window = 0;
473474
l_ptr->checkpoint = 1;

0 commit comments

Comments
 (0)