| From 95ad2545823883411569ef7be6c39a14bf469bb8 Mon Sep 17 00:00:00 2001 |
| From: Tung Nguyen <tung.q.nguyen@dektech.com.au> |
| Date: Thu, 28 Nov 2019 10:10:07 +0700 |
| Subject: [PATCH] tipc: fix wrong timeout input for tipc_wait_for_cond() |
| |
| commit 12db3c8083fcab4270866a88191933f2d9f24f89 upstream. |
| |
| In function __tipc_shutdown(), the timeout value passed to |
| tipc_wait_for_cond() is not jiffies. |
| |
| This commit fixes it by converting that value from milliseconds |
| to jiffies. |
| |
| Fixes: 365ad353c256 ("tipc: reduce risk of user starvation during link congestion") |
| Signed-off-by: Tung Nguyen <tung.q.nguyen@dektech.com.au> |
| Acked-by: Jon Maloy <jon.maloy@ericsson.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/net/tipc/socket.c b/net/tipc/socket.c |
| index cc89d4142ecb..b0ff9027f8d1 100644 |
| --- a/net/tipc/socket.c |
| +++ b/net/tipc/socket.c |
| @@ -504,7 +504,7 @@ static void __tipc_shutdown(struct socket *sock, int error) |
| struct sock *sk = sock->sk; |
| struct tipc_sock *tsk = tipc_sk(sk); |
| struct net *net = sock_net(sk); |
| - long timeout = CONN_TIMEOUT_DEFAULT; |
| + long timeout = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT); |
| u32 dnode = tsk_peer_node(tsk); |
| struct sk_buff *skb; |
| |
| -- |
| 2.7.4 |
| |