# Re: \[patch 04/15\] timers: Get rid of del\_singleshot\_timer\_sync()

- From: Steven Rostedt \<rostedt@goodmis.org\>
- Date: 2022-11-21 20:08:50 
- List: netdev
- Page: https://ratatoskr.run/netdev/2022/11/2015080
- Thread: https://ratatoskr.run/linux-bluetooth/2022/11/2006942/t.md

```text
On Tue, 15 Nov 2022 21:28:39 +0100 (CET)
Thomas Gleixner [ref] wrote:

> del_singleshot_timer_sync() used to be an optimization for deleting timers
> which are not rearmed from the timer callback function.
> 
> This optimization turned out to be broken and got mapped to
> del_timer_sync() about 17 years ago.
> 
> Get rid of the undocumented indirection and use del_timer_sync() directly.
> 
> No functional change.
> 
> Signed-off-by: Thomas Gleixner <redacted>
>


> --- a/net/sunrpc/xprt.c
> +++ b/net/sunrpc/xprt.c
> @@ -1164,7 +1164,7 @@ xprt_request_enqueue_receive(struct rpc_
>  	spin_unlock(&xprt->queue_lock);
>  
>  	/* Turn off autodisconnect */
> -	del_singleshot_timer_sync(&xprt->timer);
> +	del_timer_sync(&xprt->timer);

And this was not even a single shot timer. It used the
del_singleshot_timer_sync() function because of incorrect assumptions.

Link: https://lore.kernel.org/all/20221105060155.047357452@goodmis.org/

  0f9dc2b16884b ("RPC: Clean up socket autodisconnect")
  55c888d6d09a0 ("timers fixes/improvements")

Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve


>  	return 0;
>  }
>  

```
