Received: by 10.223.164.221 with SMTP id h29csp93200wrb; Fri, 3 Nov 2017 11:01:37 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SJTBgN9Ld/Vk+Rl+bJsnY9IlLjgn+Au6dm9a6keI4I4KW6IMpwjMBzapBcl3HxdkCTM668 X-Received: by 10.98.205.68 with SMTP id o65mr8532500pfg.117.1509732097131; Fri, 03 Nov 2017 11:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509732097; cv=none; d=google.com; s=arc-20160816; b=cAYDq7DvyKiq3wGVN5aKJ2wRBss9Jy4lK47ToId3+/dZP+iiyriXwEWaChPDgWapS7 svv3x6/tlIjvapPpfHOMBvr5Y4vbjaIdjQeLbkDcQf36W706j/BFIa5ixbWwQBev29nx PODWdXq511dQFGUzC1qkzR7rOYxLCVqGkAYjwlMI9ktoF9fglb4n/QGeTujfGmGh2c9W MFDYLm0XB8WThYX96FPnzSxCDQzIfuBy/gaZpg+zD10mx19G5E5YkAiDU8s/znp5GBVZ cp8htvfBjbrwEcG/5cWSL7YTv+ih2vF+P+9nSXSOAeOSx8Ya5SZHJqKFUOa/3om6gvGI NX/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=KZQByskc4JtAVxOLUzYSKzSlAyMih20oXLRoFrI1tak=; b=tEtXHTPJ3mpr2eSJaErwsibnEdRB6k1d9W5fJJkkMGRG+q5SUQKMECDyBO1K/+KhH+ SthV5HM4nhdNHVFhbsfKKbGLbRY1IU87suZnBq9rWXDHXoBNNt4BjvFWupLPxeRlFNk/ 0GIOI2rWDvPRJ491gKMsusaN277LuDLdOnh1+H5w2sM5dUBlVhAW8KHhHzwk2oSdcJjc 9VeAYhMlCiaKHxcHEgWP6ki4FgWHw6ATI0077HSWqPGe31WugkerEqJ0pk08EdPCw+Cu 1kMnonr/KRWFaGxX1pctROs7s5yH2g56v1oePBukb/fgKHJvbyevdzxU77D0o417tNAP MKLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Wu29pXnE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si6530498pgr.120.2017.11.03.11.01.23; Fri, 03 Nov 2017 11:01:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Wu29pXnE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933540AbdKCSAt (ORCPT + 92 others); Fri, 3 Nov 2017 14:00:49 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:46923 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932321AbdKCSAr (ORCPT ); Fri, 3 Nov 2017 14:00:47 -0400 Received: by mail-io0-f196.google.com with SMTP id 101so8056534ioj.3; Fri, 03 Nov 2017 11:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=KZQByskc4JtAVxOLUzYSKzSlAyMih20oXLRoFrI1tak=; b=Wu29pXnE12DcZ3yhJxO2/TRneEyhxD64WKQR+XeESJU+8wip7Yb5sbaXXRpFtxyVKJ PO0HsRub+U/+rb0Ygi7WCn7oDJxdPL67wddzcOeiwjS42r4uffCSZYY6/eFIpHX1MPdb eP/SrLPXqoVIWjHfTD/AVQVJtcjjpkfmmvp1eOGmc6CijemxVvmAQdxGyQ0YILFLcirh 8l649yORVmeN9ItAQX8ZzInjH/+FNDz95Tt/xLxICLiMFEab4VG0Ya4MINJ6+iHJ9AV9 dvPEQ+wey6I0QnyVOiMbO/mMohYITWbG9uxXCmi7on31WbXGJ1vvlUVMOiygg2dRxTF8 npBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KZQByskc4JtAVxOLUzYSKzSlAyMih20oXLRoFrI1tak=; b=PpQ1BulCVzeldoCdLj6w6uyyvONdyxC74J6L7m4AqdK1x8mBZJZNOI0nccG7jNt93x da+qcseNYZEW1MoolB1byzzaFgPFsvUqVVquHXATRzYXEzPTK0pbQc3vhi7ouTAS/bc+ bXxA4ZyugiJCMFuDO6s2rW+YKloVwOLTPIY46YBqk4oVG6xKNapmCxlCUHbmanz33pTx ij8N6urQhRCppWFVEhHbv7+Po16ezVzuSf1mAdAVvoeZP+Z4M1A3hY+A1SM8BBshkeeY ewUhyIT23zu0P3GNqGcO9wwAKC8pbaPpRCMbdLUo+92vxwfE1bHgKamgAZKhqR4YUcS4 JUNg== X-Gm-Message-State: AMCzsaW0JghoOegJfm705PfPHkoAzztQjr2KwkVOCoD8HwdrcgUEQgUO Cc2F+fb9c/os+S+55aJryWtgA4qoS8cyoNIKDmFFcMhL X-Received: by 10.107.9.216 with SMTP id 85mr10066425ioj.188.1509732047028; Fri, 03 Nov 2017 11:00:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.168.218 with HTTP; Fri, 3 Nov 2017 11:00:46 -0700 (PDT) In-Reply-To: <20171016235900.GA102729@beast> References: <20171016235900.GA102729@beast> From: Ryusuke Konishi Date: Sat, 4 Nov 2017 03:00:46 +0900 X-Google-Sender-Auth: 8zcKbw8fsrn82VYmI6wAgvt2q_M Message-ID: Subject: Re: [PATCH] fs/nilfs2: Convert timers to use timer_setup() To: Andrew Morton , Kees Cook Cc: linux-nilfs , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-10-17 8:59 GMT+09:00 Kees Cook : > 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. This requires adding a pointer to > hold the timer's target task, as the lifetime of sc_task doesn't appear to > match the timer's task. > > Cc: Ryusuke Konishi > Cc: linux-nilfs@vger.kernel.org > Signed-off-by: Kees Cook Looks good. Acked-by: Ryusuke Konishi Thanks, Ryusuke Konishi > --- > fs/nilfs2/segment.c | 11 +++++------ > fs/nilfs2/segment.h | 1 + > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c > index 70ded52dc1dd..07b6154a081e 100644 > --- a/fs/nilfs2/segment.c > +++ b/fs/nilfs2/segment.c > @@ -2404,11 +2404,11 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, int mode) > return err; > } > > -static void nilfs_construction_timeout(unsigned long data) > +static void nilfs_construction_timeout(struct timer_list *t) > { > - struct task_struct *p = (struct task_struct *)data; > + struct nilfs_sc_info *sci = from_timer(sci, t, sc_timer); > > - wake_up_process(p); > + wake_up_process(sci->sc_timer_task); > } > > static void > @@ -2546,8 +2546,7 @@ static int nilfs_segctor_thread(void *arg) > struct the_nilfs *nilfs = sci->sc_super->s_fs_info; > int timeout = 0; > > - sci->sc_timer.data = (unsigned long)current; > - sci->sc_timer.function = nilfs_construction_timeout; > + sci->sc_timer_task = current; > > /* start sync. */ > sci->sc_task = current; > @@ -2678,7 +2677,7 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct super_block *sb, > INIT_LIST_HEAD(&sci->sc_gc_inodes); > INIT_LIST_HEAD(&sci->sc_iput_queue); > INIT_WORK(&sci->sc_iput_work, nilfs_iput_work_func); > - init_timer(&sci->sc_timer); > + timer_setup(&sci->sc_timer, nilfs_construction_timeout, 0); > > sci->sc_interval = HZ * NILFS_SC_DEFAULT_TIMEOUT; > sci->sc_mjcp_freq = HZ * NILFS_SC_DEFAULT_SR_FREQ; > diff --git a/fs/nilfs2/segment.h b/fs/nilfs2/segment.h > index 1060949d7dd2..84084a4d9b3e 100644 > --- a/fs/nilfs2/segment.h > +++ b/fs/nilfs2/segment.h > @@ -180,6 +180,7 @@ struct nilfs_sc_info { > unsigned long sc_watermark; > > struct timer_list sc_timer; > + struct task_struct *sc_timer_task; > struct task_struct *sc_task; > }; > > -- > 2.7.4 > > > -- > Kees Cook > Pixel Security From 1581488082660404778@xxx Tue Oct 17 07:16:06 +0000 2017 X-GM-THRID: 1581488082660404778 X-Gmail-Labels: Inbox,Category Forums