From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751719AbdBYILa (ORCPT ); Sat, 25 Feb 2017 03:11:30 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:3291 "EHLO dggrg01-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751419AbdBYIL2 (ORCPT ); Sat, 25 Feb 2017 03:11:28 -0500 Subject: Re: [PATCH] f2fs: change the codes of checking CP_CRC_RECOVERY_FLAG to macro To: Jaegeuk Kim References: <1487930771-14491-1-git-send-email-yunlong.song@huawei.com> <096f8d0b-774c-2065-db96-dde455a4ec53@huawei.com> <58B014FC.6090308@huawei.com> <3e2f166f-e532-a04b-d8dd-6b21d7243bc4@huawei.com> <58B01FC0.8060901@huawei.com> <20170224181235.GC39009@jaegeuk.local> CC: Chao Yu , , , , , , , , From: Yunlong Song Message-ID: <58B13C05.50900@huawei.com> Date: Sat, 25 Feb 2017 16:10:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20170224181235.GC39009@jaegeuk.local> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.74.205] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.58B13C1C.015D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 70b5322a58f81e49b986d690eb5ac7a2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/2/25 2:12, Jaegeuk Kim wrote: > > This is to handle only one case in which: > > 1. uses old kernel without this flag, > 2. calls fsync and gets sudden power-cut, > 3. updates new kernel having this flag before mount. > > Then, if we do not check this flag at mount time, we will lose the last fsync'ed > node blocks. > So I just send a v2 patch to only change to macro in fill_node_footer_blkaddr and allocate_segment_by_default, these two functions are called frequently, so it is better to use macro code. And I remain the original checking code in is_recoverable_dnode, this function is called only once after mount, it's OK. -- Thanks, Yunlong Song