[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221105060155.047357452@goodmis.org>
Date: Sat, 05 Nov 2022 02:00:25 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Stephen Boyd <sboyd@...nel.org>,
Guenter Roeck <linux@...ck-us.net>,
Anna-Maria Gleixner <anna-maria@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Chuck Lever <chuck.lever@...cle.com>,
Jeff Layton <jlayton@...nel.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, linux-nfs@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH v4a 01/38] SUNRPC/xprt: Use del_timer_sync() instead of
del_singleshot_timer_sync()
From: "Steven Rostedt (Google)" <rostedt@...dmis.org>
Back on June 22, 2005, it was decided to use del_singleshot_timer_sync()
because it wouldn't loop like del_timer_sync(), and since the timer that
was being removed was not about to be rearmed, it was considered an
efficiency to use del_singleshot_timer_sync() over del_timer_sync().
But on June 23, 2005, commit 55c888d6d09a0 ("timers fixes/improvements")
happened, which converted del_singleshot_timer_sync() into:
#define del_singleshot_timer_sync(t) del_timer_sync(t)
Making the to equivalent.
Now work is being done to add a "shutdown" state to timers where a timer
must be in that state in order to be freed to prevent use-after-free bugs
caused by timers being re-armed just before being freed, the
del_singleshot_timer_sync() is now being converted into something that
will set the timer to the shutdown state. This means that once
del_singleshot_timer_sync() is called, the timer can no longer be
re-armed.
As the timer here will be re-armed, it can not use del_singleshot_timer_sync().
But as the reason it was used in the first place no longer exists, just
use del_timer_sync().
Link: https://lore.kernel.org/lkml/20221028145005.28bc324d@gandalf.local.home/
Cc: Chuck Lever <chuck.lever@...cle.com>
Cc: Jeff Layton <jlayton@...nel.org>
Cc: Trond Myklebust <trond.myklebust@...merspace.com>
Cc: Anna Schumaker <anna@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>
Cc: linux-nfs@...r.kernel.org
Cc: netdev@...r.kernel.org
Fixes: 0f9dc2b16884b ("RPC: Clean up socket autodisconnect")
Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>
---
net/sunrpc/xprt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 656cec208371..ab453ede54f0 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1164,7 +1164,7 @@ xprt_request_enqueue_receive(struct rpc_task *task)
spin_unlock(&xprt->queue_lock);
/* Turn off autodisconnect */
- del_singleshot_timer_sync(&xprt->timer);
+ del_timer_sync(&xprt->timer);
return 0;
}
--
2.35.1
Powered by blists - more mailing lists