From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gu Zheng Subject: [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes Date: Mon, 21 Oct 2013 15:19:16 +0800 Message-ID: <5264D574.6000105@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VYAPY-0002KV-FM for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Oct 2013 08:00:24 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1VYAPX-0002Z4-5e for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Oct 2013 08:00:24 +0000 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Kim Cc: fsdevel , linux-kernel , f2fs In sync_dirty_dir_inodes(), remove_dirty_dir_inode() will be called in the callback of filemap_flush to delete and free dirty dir inode entry. But for the freeing inode entry, missed this step after sbumit data bio, and this may lead to a dead loop if these is freeing inode entry in dir_inode_list. So add the delete and free step to fix it. Signed-off-by: Gu Zheng --- fs/f2fs/checkpoint.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 8d16071..f61838f 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -600,7 +600,16 @@ retry: * wribacking dentry pages in the freeing inode. */ f2fs_submit_bio(sbi, DATA, true); + + spin_lock(&sbi->dir_inode_lock); + list_del(&entry->list); +#ifdef CONFIG_F2FS_STAT_FS + sbi->n_dirty_dirs--; +#endif + spin_unlock(&sbi->dir_inode_lock); + kmem_cache_free(inode_entry_slab, entry); } + goto retry; } -- 1.7.7 ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844Ab3JUIAd (ORCPT ); Mon, 21 Oct 2013 04:00:33 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:46086 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752574Ab3JUIAM (ORCPT ); Mon, 21 Oct 2013 04:00:12 -0400 X-IronPort-AV: E=Sophos;i="4.93,537,1378828800"; d="scan'208";a="8814302" Message-ID: <5264D574.6000105@cn.fujitsu.com> Date: Mon, 21 Oct 2013 15:19:16 +0800 From: Gu Zheng User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Kim CC: f2fs , fsdevel , linux-kernel Subject: [PATCH] f2fs: delete and free dirty dir freeing inode entry when sync dirty dir inodes X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/10/21 15:22:33, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/10/21 15:24:14, Serialize complete at 2013/10/21 15:24:14 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In sync_dirty_dir_inodes(), remove_dirty_dir_inode() will be called in the callback of filemap_flush to delete and free dirty dir inode entry. But for the freeing inode entry, missed this step after sbumit data bio, and this may lead to a dead loop if these is freeing inode entry in dir_inode_list. So add the delete and free step to fix it. Signed-off-by: Gu Zheng --- fs/f2fs/checkpoint.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 8d16071..f61838f 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -600,7 +600,16 @@ retry: * wribacking dentry pages in the freeing inode. */ f2fs_submit_bio(sbi, DATA, true); + + spin_lock(&sbi->dir_inode_lock); + list_del(&entry->list); +#ifdef CONFIG_F2FS_STAT_FS + sbi->n_dirty_dirs--; +#endif + spin_unlock(&sbi->dir_inode_lock); + kmem_cache_free(inode_entry_slab, entry); } + goto retry; } -- 1.7.7