Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp653300pxb; Tue, 3 Nov 2020 08:59:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGqWfFAGz9s4QugXoI5cTxMZD7m/6XBJ6rCTwgbYenhRZ17BGUyXg6vBQad/pxW2KqWpPS X-Received: by 2002:a50:dac1:: with SMTP id s1mr22737505edj.74.1604422752908; Tue, 03 Nov 2020 08:59:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604422752; cv=none; d=google.com; s=arc-20160816; b=bv2yiayWWS+GGs9PBaiES7vVJgEy4Y9de2U/6szZjOgur1JnErGP3Ih7UbEa9hxefU FiLH6QjGnH/CvujABiie0b5x/liKlktoNYY8McBMlUg/5KzsBJ0rG9lHF4ZU4RgkIp0N LqE3HtGuVFs7iKCLjUPop/rqQGgC4i0L98UGP7L8r6mb/T1Ww+VeZz21XI51l+jKDgGP 2E8BCPQjT79LbcX280QuDBMPgkvcUPNRg0rfIdx1unGySIT3ZtFgGkhcPyAKeevzzNMo Ns/Iq903xSkRvhpGxgex4Px95b1t7VCq83KQqJbHkGRkSVKuEahmkEJ1phW1TsTlaPEd mvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BGnNhINmw5N94WNCRFtZuQGevi3BapfkmWhq7wkXfEk=; b=Jd9KhRfQmFcagFDpaqa84nu3stgJF2Rvm4D6nDzy/Ln+i4uCfmaltzV9VZxvZKDtIH ug2DWEbJfOnbQ3HJyopRFwfNIefVpug6ciOIHizEuIhH9FHHLiT/zLi2neXisMVe0OjN Pgm4/Xp1nLFMX6uwPyy+FYpGfnnjZy27IzS/tOMpaJ/cvL2GAJXcc08PLATtwRNiIyFm kMTfTNOxjEUvRfw9Yi04KyeE7qwY+Uvc8RQ1WS91NaXCmDi6hu5VnRx24Ro2soy489mb i3pVCvKAEJcLl0ERp8FPBFE01lrtzyHLKzdIIZWtlgyLSA69fcyi30yX0xneJK8I0TMl 2o/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o20si12863508ejn.279.2020.11.03.08.58.47; Tue, 03 Nov 2020 08:59:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727530AbgKCQ6m (ORCPT + 99 others); Tue, 3 Nov 2020 11:58:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:36238 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726581AbgKCQ6m (ORCPT ); Tue, 3 Nov 2020 11:58:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C742CAD29; Tue, 3 Nov 2020 16:58:40 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7DC511E12FB; Tue, 3 Nov 2020 17:58:40 +0100 (CET) Date: Tue, 3 Nov 2020 17:58:40 +0100 From: Jan Kara To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz, Andrea Righi Subject: Re: [PATCH 08/10] ext4: fix inode dirty check in case of fast commits Message-ID: <20201103165840.GL3440@quack2.suse.cz> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-9-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031200518.4178786-9-harshadshirwadkar@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 31-10-20 13:05:16, Harshad Shirwadkar wrote: > In case of fast commits, determine if the inode is dirty by checking > if the inode is on fast commit list. This also helps us get rid of > ext4_inode_info.i_fc_committed_subtid field. > > Reported-by: Andrea Righi > Signed-off-by: Harshad Shirwadkar Nice cleanup and looks good to me! You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/ext4.h | 3 --- > fs/ext4/fast_commit.c | 3 --- > fs/ext4/inode.c | 3 +-- > 3 files changed, 1 insertion(+), 8 deletions(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index 573db158382f..7222a9ba5d66 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -1028,9 +1028,6 @@ struct ext4_inode_info { > * protected by sbi->s_fc_lock. > */ > > - /* Fast commit subtid when this inode was committed */ > - unsigned int i_fc_committed_subtid; > - > /* Start of lblk range that needs to be committed in this fast commit */ > ext4_lblk_t i_fc_lblk_start; > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c > index b7b1fe6dbb24..4c0a3e858ea3 100644 > --- a/fs/ext4/fast_commit.c > +++ b/fs/ext4/fast_commit.c > @@ -152,7 +152,6 @@ void ext4_fc_init_inode(struct inode *inode) > INIT_LIST_HEAD(&ei->i_fc_list); > init_waitqueue_head(&ei->i_fc_wait); > atomic_set(&ei->i_fc_updates, 0); > - ei->i_fc_committed_subtid = 0; > } > > static void ext4_fc_wait_committing_inode(struct inode *inode) > @@ -1026,8 +1025,6 @@ static int ext4_fc_perform_commit(journal_t *journal) > if (ret) > goto out; > spin_lock(&sbi->s_fc_lock); > - EXT4_I(inode)->i_fc_committed_subtid = > - atomic_read(&sbi->s_fc_subtid); > } > spin_unlock(&sbi->s_fc_lock); > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 7f6af784e74f..d36c3908272f 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3311,8 +3311,7 @@ static bool ext4_inode_datasync_dirty(struct inode *inode) > EXT4_I(inode)->i_datasync_tid)) > return false; > if (test_opt2(inode->i_sb, JOURNAL_FAST_COMMIT)) > - return atomic_read(&EXT4_SB(inode->i_sb)->s_fc_subtid) < > - EXT4_I(inode)->i_fc_committed_subtid; > + return !list_empty(&EXT4_I(inode)->i_fc_list); > return true; > } > > -- > 2.29.1.341.ge80a0c044ae-goog > -- Jan Kara SUSE Labs, CR