Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754845AbeAKJw6 (ORCPT + 1 other); Thu, 11 Jan 2018 04:52:58 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:58609 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754388AbeAKJw4 (ORCPT ); Thu, 11 Jan 2018 04:52:56 -0500 Subject: Re: [f2fs-dev] [PATCH] f2fs: prevent newly created inode from being dirtied incorrectly To: Daeho Jeong , , References: <1515637579-8360-1-git-send-email-daeho.jeong@samsung.com> From: Chao Yu Message-ID: <3a679d9e-8beb-8e65-d96a-e0850ca7fa4d@huawei.com> Date: Thu, 11 Jan 2018 17:52:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1515637579-8360-1-git-send-email-daeho.jeong@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 2018/1/11 10:26, Daeho Jeong wrote: > Now, we invoke f2fs_mark_inode_dirty_sync() to make an inode dirty in > advance of creating a new node page for the inode. By this, some inodes > whose node page is not created yet can be linked into the global dirty > list. > > If the checkpoint is executed at this moment, the inode will be written > back by writeback_single_inode() and finally update_inode_page() will > fail to detach the inode from the global dirty list because the inode > doesn't have a node page. > > The problem is that the inode's state in VFS layer will become clean > after execution of writeback_single_inode() and it's still linked in > the global dirty list of f2fs and this will cause a kernel panic. > > So, we will prevent the newly created inode from being dirtied during > the FI_NEW_INODE flag of the inode is set. We will make it dirty > right after the flag is cleared. > > Signed-off-by: Daeho Jeong > Signed-off-by: Youngjin Gil > Tested-by: Hobin Woo Reviewed-by: Chao Yu Thanks,