From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756115AbdJJLUy (ORCPT ); Tue, 10 Oct 2017 07:20:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:42361 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755890AbdJJLUx (ORCPT ); Tue, 10 Oct 2017 07:20:53 -0400 Date: Tue, 10 Oct 2017 13:20:50 +0200 From: Jan Kara To: Kees Cook Cc: linux-kernel@vger.kernel.org, "Theodore Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH] jbd2: Convert timers to use timer_setup() Message-ID: <20171010112050.GB3667@quack2.suse.cz> References: <20171005004846.GA23025@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171005004846.GA23025@beast> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 04-10-17 17:48:46, Kees Cook wrote: > In preparation for unconditionally passing the struct timer_list pointer to > all timer callbacks, switch to using the new timer_setup() and from_timer() > to pass the timer pointer explicitly. > > Cc: "Theodore Ts'o" > Cc: Jan Kara > Cc: linux-ext4@vger.kernel.org > Cc: Thomas Gleixner > Signed-off-by: Kees Cook The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > This requires commit 686fef928bba ("timer: Prepare to change timer > callback argument type") in v4.14-rc3, but should be otherwise > stand-alone. > --- > fs/jbd2/journal.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index 7d5ef3bf3f3e..d2a85c9720e9 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -165,11 +165,11 @@ static void jbd2_superblock_csum_set(journal_t *j, journal_superblock_t *sb) > * Helper function used to manage commit timeouts > */ > > -static void commit_timeout(unsigned long __data) > +static void commit_timeout(struct timer_list *t) > { > - struct task_struct * p = (struct task_struct *) __data; > + journal_t *journal = from_timer(journal, t, j_commit_timer); > > - wake_up_process(p); > + wake_up_process(journal->j_task); > } > > /* > @@ -197,8 +197,7 @@ static int kjournald2(void *arg) > * Set up an interval timer which can be used to trigger a commit wakeup > * after the commit interval expires > */ > - setup_timer(&journal->j_commit_timer, commit_timeout, > - (unsigned long)current); > + timer_setup(&journal->j_commit_timer, commit_timeout, 0); > > set_freezable(); > > -- > 2.7.4 > > > -- > Kees Cook > Pixel Security > -- Jan Kara SUSE Labs, CR