From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754048AbcHRJp2 (ORCPT ); Thu, 18 Aug 2016 05:45:28 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:62355 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753871AbcHRJp0 (ORCPT ); Thu, 18 Aug 2016 05:45:26 -0400 Subject: Re: [PATCH] f2fs: set dirty state for filesystem only when updating meta data To: References: <20160818090523.57556-1-yuchao0@huawei.com> CC: , From: Chao Yu Message-ID: <88352fee-4f32-1600-60e3-3bd30a98f96f@huawei.com> Date: Thu, 18 Aug 2016 17:45:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160818090523.57556-1-yuchao0@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.57B583AD.000C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e744015fe4b43615a9022244b5b22b1f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/18 17:05, Chao Yu wrote: > We don't guarantee integrity of user data after checkpoint, since we only > guarantee meta data integrity for data consistency of filesystem. > > Due to above reason, we only need to set fs as dirty when meta data is > updated, so that we can skip writing checkpoint in some case of non-meta > data is updated. > > Signed-off-by: Chao Yu > --- > fs/f2fs/f2fs.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index 5a10bce..1659d10 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -1220,7 +1220,9 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi, > static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type) > { > percpu_counter_inc(&sbi->nr_pages[count_type]); > - set_sbi_flag(sbi, SBI_IS_DIRTY); > + if (count_type == F2FS_DIRTY_DENTS || count_type == F2FS_DIRTY_NODES || > + count_type == F2FS_DIRTY_META) Sorry, I miss one condition here, please ignore this patch. Thanks, > + set_sbi_flag(sbi, SBI_IS_DIRTY); > } > > static inline void inode_inc_dirty_pages(struct inode *inode) >