Skip to content

Commit 3e2dfb5

Browse files
Hoang LeKelsey Skunberg
authored andcommitted
tipc: increase timeout in tipc_sk_enqueue()
BugLink: https://bugs.launchpad.net/bugs/1946802 commit f4bb62e upstream. In tipc_sk_enqueue() we use hardcoded 2 jiffies to extract socket buffer from generic queue to particular socket. The 2 jiffies is too short in case there are other high priority tasks get CPU cycles for multiple jiffies update. As result, no buffer could be enqueued to particular socket. To solve this, we switch to use constant timeout 20msecs. Then, the function will be expired between 2 jiffies (CONFIG_100HZ) and 20 jiffies (CONFIG_1000HZ). Fixes: c637c10 ("tipc: resolve race problem at unicast message reception") Acked-by: Jon Maloy <[email protected]> Signed-off-by: Hoang Le <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Kelsey Skunberg <[email protected]>
1 parent bc8ca58 commit 3e2dfb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/tipc/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,7 @@ static int tipc_sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
22752275
static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
22762276
u32 dport, struct sk_buff_head *xmitq)
22772277
{
2278-
unsigned long time_limit = jiffies + 2;
2278+
unsigned long time_limit = jiffies + usecs_to_jiffies(20000);
22792279
struct sk_buff *skb;
22802280
unsigned int lim;
22812281
atomic_t *dcnt;

0 commit comments

Comments
 (0)