[RFC,v3,28/33] timers: fs/nilfs2: Use timer_shutdown_sync() before freeing timer

Message ID 20221104054917.009383303@goodmis.org
State New
Headers
Series timers: Use timer_shutdown*() before freeing timers |

Commit Message

Steven Rostedt Nov. 4, 2022, 5:41 a.m. UTC
  From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Before a timer is freed, timer_shutdown_sync() must be called.

Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/

Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: linux-nilfs@vger.kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 fs/nilfs2/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ryusuke Konishi Nov. 4, 2022, 6:57 a.m. UTC | #1
On Fri, Nov 4, 2022 at 2:48 PM Steven Rostedt wrote:
>
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> Before a timer is freed, timer_shutdown_sync() must be called.
>
> Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/
>
> Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
> Cc: linux-nilfs@vger.kernel.org
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  fs/nilfs2/segment.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index b4cebad21b48..c50dc377da26 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -2752,7 +2752,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
>
>         down_write(&nilfs->ns_segctor_sem);
>
> -       del_timer_sync(&sci->sc_timer);
> +       timer_shutdown_sync(&sci->sc_timer);
>         kfree(sci);
>  }
>
> --
> 2.35.1

Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>

This is the second time, but my Ack is not tagged, so I'll reply again
just in case.

Thanks,
Ryusuke Konishi
  
Steven Rostedt Nov. 4, 2022, 6:54 p.m. UTC | #2
On Fri, 4 Nov 2022 15:57:04 +0900
Ryusuke Konishi <konishi.ryusuke@gmail.com> wrote:

> On Fri, Nov 4, 2022 at 2:48 PM Steven Rostedt wrote:
> >
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> >
> > Before a timer is freed, timer_shutdown_sync() must be called.
> >
> > Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/
> >
> > Cc: Ryusuke Konishi <konishi.ryusuke@gmail.com>
> > Cc: linux-nilfs@vger.kernel.org
> > Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> > ---
> >  fs/nilfs2/segment.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> > index b4cebad21b48..c50dc377da26 100644
> > --- a/fs/nilfs2/segment.c
> > +++ b/fs/nilfs2/segment.c
> > @@ -2752,7 +2752,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
> >
> >         down_write(&nilfs->ns_segctor_sem);
> >
> > -       del_timer_sync(&sci->sc_timer);
> > +       timer_shutdown_sync(&sci->sc_timer);
> >         kfree(sci);
> >  }
> >
> > --
> > 2.35.1  
> 
> Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
> 
> This is the second time, but my Ack is not tagged, so I'll reply again
> just in case.
>

Thanks. I might have missed it, but I also changed the name, and wanted
to make sure everyone saw that ;-)

-- Steve
  

Patch

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index b4cebad21b48..c50dc377da26 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -2752,7 +2752,7 @@  static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
 
 	down_write(&nilfs->ns_segctor_sem);
 
-	del_timer_sync(&sci->sc_timer);
+	timer_shutdown_sync(&sci->sc_timer);
 	kfree(sci);
 }