Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp657680pxb; Tue, 3 Nov 2020 09:04:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZirpAkrPtx8x/xEi+ZwVIPvzQhZPCzLdMArHLl/E14NuWp/DyR7slaNwwbNVLshKvHO7G X-Received: by 2002:a17:906:402:: with SMTP id d2mr19859989eja.165.1604423042343; Tue, 03 Nov 2020 09:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604423042; cv=none; d=google.com; s=arc-20160816; b=KOwA79xK/7A4UsRHslrzVdMPnJ5HaPUNHAciU0gP0UlKrK57jjh5SW7t4zagTvzS/0 f8V0HqV0OelSFgiyUEZffHithuD7oKRfN5UzrzK+Psb0BiPCF8xp9+RqrLMoipBenF7e 6xZTkMsjATdlKGrYVy/pmT1sLZTKGhMZOhk8Nluhk9xmS9otpTny6huTXjJWCfyf8fdS zS9cAaUhNlrl2qJ1vV1lppAHdzphJUL/oQ7chyp5cIQ1qOWuwdEgHkSVuRvcRNP6CmQS rWWYPoX+daX4zyjwpUNyw4sItLCKjB+v5TdD2mgq/Sg5zbeBgez5VWSYGlpHavyvgyZw 1oUg== 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=cC5hm4/WZIH6zmZsk2HcA3mYeRb5ZyFPMigcnhaZmqA=; b=NsENmM6ptth0PJfG9kFr4BJ+alEjm0+/jq10MEFyEvoVCWROxdLV+kHy+p7VNwjAzn CycQ1pPItMTvKJrAU4rmProWgXb+bNbp7NL3MdqE0S3CTw4Xure7ohI6u5tWA4nO2shH XEIQ577auEMot9skxHQU4WYaeqYl+bhZuimjcIKJciRKB/mHC+5xLODKmzIEP4ANxU34 HbkdPH2vJtbxG7gTnYJdEsbjdd8cxj5IFHsGafP6HrGUPP5xs2AQhs86m+kZjGcnrxTo 4A6YM3Pvar1sJe/0rO+plOwcVTLc5IL4pgTMD7sMj1jnJkXU6BIBsno3Kd2DWxg94Afm HErA== 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 u17si12168638ejr.241.2020.11.03.09.03.37; Tue, 03 Nov 2020 09:04:02 -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 S1727323AbgKCRBC (ORCPT + 99 others); Tue, 3 Nov 2020 12:01:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:38284 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725993AbgKCRBC (ORCPT ); Tue, 3 Nov 2020 12:01:02 -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 E6260AD29; Tue, 3 Nov 2020 17:01:00 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id AEFCB1E12FB; Tue, 3 Nov 2020 18:01:00 +0100 (CET) Date: Tue, 3 Nov 2020 18:01:00 +0100 From: Jan Kara To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz Subject: Re: [PATCH 09/10] ext4: disable fast commit with data journalling Message-ID: <20201103170100.GM3440@quack2.suse.cz> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-10-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031200518.4178786-10-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:17, Harshad Shirwadkar wrote: > Fast commits don't work with data journalling. This patch disables the > fast commit support when data journalling is turned on. > > Suggested-by: Jan Kara > Signed-off-by: Harshad Shirwadkar The patch looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/fast_commit.c | 7 +++++++ > fs/ext4/fast_commit.h | 1 + > fs/ext4/super.c | 3 ++- > include/trace/events/ext4.h | 6 ++++-- > 4 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c > index 4c0a3e858ea3..9ae8ba213961 100644 > --- a/fs/ext4/fast_commit.c > +++ b/fs/ext4/fast_commit.c > @@ -472,6 +472,12 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode) > if (S_ISDIR(inode->i_mode)) > return; > > + if (ext4_should_journal_data(inode)) { > + ext4_fc_mark_ineligible(inode->i_sb, > + EXT4_FC_REASON_INODE_JOURNAL_DATA); > + return; > + } > + > ret = ext4_fc_track_template(handle, inode, __track_inode, NULL, 1); > trace_ext4_fc_track_inode(inode, ret); > } > @@ -2095,6 +2101,7 @@ const char *fc_ineligible_reasons[] = { > "Resize", > "Dir renamed", > "Falloc range op", > + "Data journalling", > "FC Commit Failed" > }; > > diff --git a/fs/ext4/fast_commit.h b/fs/ext4/fast_commit.h > index cde86747faf8..cdb36a10dfd0 100644 > --- a/fs/ext4/fast_commit.h > +++ b/fs/ext4/fast_commit.h > @@ -105,6 +105,7 @@ enum { > EXT4_FC_REASON_RESIZE, > EXT4_FC_REASON_RENAME_DIR, > EXT4_FC_REASON_FALLOC_RANGE, > + EXT4_FC_REASON_INODE_JOURNAL_DATA, > EXT4_FC_COMMIT_FAILED, > EXT4_FC_REASON_MAX > }; > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index e67d2fa41a78..9333475737ac 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -4340,9 +4340,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > #endif > > if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { > - printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, and O_DIRECT support!\n"); > + printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, O_DIRECT and fast_commit support!\n"); > /* can't mount with both data=journal and dioread_nolock. */ > clear_opt(sb, DIOREAD_NOLOCK); > + clear_opt2(sb, JOURNAL_FAST_COMMIT); > if (test_opt2(sb, EXPLICIT_DELALLOC)) { > ext4_msg(sb, KERN_ERR, "can't mount with " > "both data=journal and delalloc"); > diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h > index 239e98014f9b..ee7362f31eb6 100644 > --- a/include/trace/events/ext4.h > +++ b/include/trace/events/ext4.h > @@ -104,7 +104,8 @@ TRACE_DEFINE_ENUM(ES_REFERENCED_B); > { EXT4_FC_REASON_SWAP_BOOT, "SWAP_BOOT"}, \ > { EXT4_FC_REASON_RESIZE, "RESIZE"}, \ > { EXT4_FC_REASON_RENAME_DIR, "RENAME_DIR"}, \ > - { EXT4_FC_REASON_FALLOC_RANGE, "FALLOC_RANGE"}) > + { EXT4_FC_REASON_FALLOC_RANGE, "FALLOC_RANGE"}, \ > + { EXT4_FC_REASON_INODE_JOURNAL_DATA, "INODE_JOURNAL_DATA"}) > > TRACE_EVENT(ext4_other_inode_update_time, > TP_PROTO(struct inode *inode, ino_t orig_ino), > @@ -2917,7 +2918,7 @@ TRACE_EVENT(ext4_fc_stats, > ), > > TP_printk("dev %d:%d fc ineligible reasons:\n" > - "%s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d; " > + "%s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d, %s:%d; " > "num_commits:%ld, ineligible: %ld, numblks: %ld", > MAJOR(__entry->dev), MINOR(__entry->dev), > FC_REASON_NAME_STAT(EXT4_FC_REASON_XATTR), > @@ -2928,6 +2929,7 @@ TRACE_EVENT(ext4_fc_stats, > FC_REASON_NAME_STAT(EXT4_FC_REASON_RESIZE), > FC_REASON_NAME_STAT(EXT4_FC_REASON_RENAME_DIR), > FC_REASON_NAME_STAT(EXT4_FC_REASON_FALLOC_RANGE), > + FC_REASON_NAME_STAT(EXT4_FC_REASON_INODE_JOURNAL_DATA), > __entry->sbi->s_fc_stats.fc_num_commits, > __entry->sbi->s_fc_stats.fc_ineligible_commits, > __entry->sbi->s_fc_stats.fc_numblks) > -- > 2.29.1.341.ge80a0c044ae-goog > -- Jan Kara SUSE Labs, CR