rxrpc: Fix resend event time calculation
authorMarc Dionne <marc.dionne@auristor.com>
Fri, 30 Mar 2018 20:04:44 +0000 (21:04 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 30 Mar 2018 20:04:44 +0000 (21:04 +0100)
commit59299aa1028fce051adbd25aaff7c387b865cd6d
tree5c02b8a8a6e772dc42e387ba6bd88dba08248b96
parent57b0c9d49b94bbeb53649b7fbd264603c1ebd585
rxrpc: Fix resend event time calculation

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