From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 05/12] rxrpc: Fix resend event time calculation
Date: Fri, 30 Mar 2018 22:14:35 +0100 [thread overview]
Message-ID: <152244447551.4629.14677984551976863759.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <152244444395.4629.2080470182140292459.stgit@warthog.procyon.org.uk>
From: Marc Dionne <marc.dionne@auristor.com>
Commit a158bdd3 ("rxrpc: Fix call timeouts") reworked the time calculation
for the next resend event. For this calculation, "oldest" will be before
"now", so ktime_sub(oldest, now) will yield a negative value. When passed
to nsecs_to_jiffies which expects an unsigned value, the end result will be
a very large value, and a resend event scheduled far into the future. This
could cause calls to stall if some packets were lost.
Fix by ordering the arguments to ktime_sub correctly.
Fixes: a158bdd3247b ("rxrpc: Fix call timeouts")
Signed-off-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---
net/rxrpc/call_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index 3dee89c7a06e..6e0d788b4dc4 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -226,7 +226,7 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
ktime_to_ns(ktime_sub(skb->tstamp, max_age)));
}
- resend_at = nsecs_to_jiffies(ktime_to_ns(ktime_sub(oldest, now)));
+ resend_at = nsecs_to_jiffies(ktime_to_ns(ktime_sub(now, oldest)));
resend_at += jiffies + rxrpc_resend_timeout;
WRITE_ONCE(call->resend_at, resend_at);
next prev parent reply other threads:[~2018-03-30 21:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-30 21:14 [PATCH net-next 00/12] rxrpc: Fixes and more traces David Howells
2018-03-30 21:14 ` [PATCH net-next 01/12] rxrpc: Fix firewall route keepalive David Howells
2018-03-30 21:14 ` [PATCH net-next 02/12] rxrpc: Fix a bit of time confusion David Howells
2018-03-30 21:14 ` [PATCH net-next 03/12] rxrpc: Fix Tx ring annotation after initial Tx failure David Howells
2018-03-30 21:14 ` [PATCH net-next 04/12] rxrpc: Don't treat call aborts as conn aborts David Howells
2018-03-30 21:14 ` David Howells [this message]
2018-03-30 21:14 ` [PATCH net-next 06/12] rxrpc: remove unused static variables David Howells
2018-03-30 21:14 ` [PATCH net-next 07/12] rxrpc: Fix checker warnings and errors David Howells
2018-03-30 21:14 ` [PATCH net-next 08/12] rxrpc: Fix potential call vs socket/net destruction race David Howells
2018-03-30 21:15 ` [PATCH net-next 09/12] rxrpc: Add a tracepoint to track rxrpc_local refcounting David Howells
2018-03-30 21:15 ` [PATCH net-next 10/12] rxrpc: Fix apparent leak of rxrpc_local objects David Howells
2018-03-30 21:15 ` [PATCH net-next 11/12] rxrpc: Add a tracepoint to track rxrpc_peer refcounting David Howells
2018-03-30 21:15 ` [PATCH net-next 12/12] rxrpc: Fix leak of rxrpc_peer objects David Howells
2018-04-01 2:29 ` [PATCH net-next 00/12] rxrpc: Fixes and more traces 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=152244447551.4629.14677984551976863759.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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