Patch "sctp: do not check hb_timer.expires when resetting hb_timer" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sctp: do not check hb_timer.expires when resetting hb_timer

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sctp-do-not-check-hb_timer.expires-when-resetting-hb.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f2101fdcb7a5483f2f2982bb9045d281b3fb17db
Author: Xin Long <lucien.xin@xxxxxxxxx>
Date:   Mon Jan 30 11:25:33 2023 -0500

    sctp: do not check hb_timer.expires when resetting hb_timer
    
    [ Upstream commit 8f35ae17ef565a605de5f409e04bcd49a55d7646 ]
    
    It tries to avoid the frequently hb_timer refresh in commit ba6f5e33bdbb
    ("sctp: avoid refreshing heartbeat timer too often"), and it only allows
    mod_timer when the new expires is after hb_timer.expires. It means even
    a much shorter interval for hb timer gets applied, it will have to wait
    until the current hb timer to time out.
    
    In sctp_do_8_2_transport_strike(), when a transport enters PF state, it
    expects to update the hb timer to resend a heartbeat every rto after
    calling sctp_transport_reset_hb_timer(), which will not work as the
    change mentioned above.
    
    The frequently hb_timer refresh was caused by sctp_transport_reset_timers()
    called in sctp_outq_flush() and it was already removed in the commit above.
    So we don't have to check hb_timer.expires when resetting hb_timer as it is
    now not called very often.
    
    Fixes: ba6f5e33bdbb ("sctp: avoid refreshing heartbeat timer too often")
    Signed-off-by: Xin Long <lucien.xin@xxxxxxxxx>
    Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@xxxxxxxxx>
    Link: https://lore.kernel.org/r/d958c06985713ec84049a2d5664879802710179a.1675095933.git.lucien.xin@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index af56651169b2..79d2aa44c6e5 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -210,9 +210,7 @@ void sctp_transport_reset_hb_timer(struct sctp_transport *transport)
 
 	/* When a data chunk is sent, reset the heartbeat interval.  */
 	expires = jiffies + sctp_transport_timeout(transport);
-	if ((time_before(transport->hb_timer.expires, expires) ||
-	     !timer_pending(&transport->hb_timer)) &&
-	    !mod_timer(&transport->hb_timer,
+	if (!mod_timer(&transport->hb_timer,
 		       expires + prandom_u32_max(transport->rto)))
 		sctp_transport_hold(transport);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux