netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tung Nguyen <tung.q.nguyen@dektech.com.au>
To: davem@davemloft.net, netdev@vger.kernel.org,
	tipc-discussion@lists.sourceforge.net
Subject: [tipc-discussion] [net v1 3/4] tipc: fix wrong timeout input for tipc_wait_for_cond()
Date: Thu, 28 Nov 2019 10:10:07 +0700	[thread overview]
Message-ID: <20191128031008.2045-4-tung.q.nguyen@dektech.com.au> (raw)
In-Reply-To: <20191128031008.2045-1-tung.q.nguyen@dektech.com.au>

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>
---
 net/tipc/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index fb5595081a05..da5fb84852a6 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -532,7 +532,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.17.1


  parent reply	other threads:[~2019-11-28  3:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28  3:10 [tipc-discussion] [net v1 0/4] Fix some bugs at socket layer Tung Nguyen
2019-11-28  3:10 ` [tipc-discussion] [net v1 1/4] tipc: fix potential memory leak in __tipc_sendmsg() Tung Nguyen
2019-11-28  3:10 ` [tipc-discussion] [net v1 2/4] tipc: fix wrong socket reference counter after tipc_sk_timeout() returns Tung Nguyen
2019-11-28  3:10 ` Tung Nguyen [this message]
2019-11-28  3:10 ` [tipc-discussion] [net v1 4/4] tipc: fix duplicate SYN messages under link congestion Tung Nguyen
2019-11-29  7:09 ` [tipc-discussion] [net v1 0/4] Fix some bugs at socket layer David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191128031008.2045-4-tung.q.nguyen@dektech.com.au \
    --to=tung.q.nguyen@dektech.com.au \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).