From mboxrd@z Thu Jan 1 00:00:00 1970 From: Changman Lee Subject: Re: [f2fs-dev] [PATCH] f2fs: Fix bad unlock balance detected. Date: Tue, 29 Jan 2013 10:21:27 +0900 Message-ID: <1359422487.19945.23.camel@lcm> References: <201301281903308261110@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "jaegeuk.kim" , linux-fsdevel , linux-f2fs-devel To: majianpeng Return-path: Received: from mailout4.samsung.com ([203.254.224.34]:32022 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342Ab3A2BW6 (ORCPT ); Mon, 28 Jan 2013 20:22:58 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHD0042B560X850@mailout4.samsung.com> for linux-fsdevel@vger.kernel.org; Tue, 29 Jan 2013 10:22:56 +0900 (KST) Received: from [12.52.124.222] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHD00FBP568KW80@mmp2.samsung.com> for linux-fsdevel@vger.kernel.org; Tue, 29 Jan 2013 10:22:56 +0900 (KST) In-reply-to: <201301281903308261110@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The blocked means gc can't proceed anymore due to not enough free secti= ons. Look at the f2fs_gc -> do_garbage_collect -> gc_node_segment and gc_dat= a_segment. Before returning GC_BLOCKED as gc_status, mutex_lock(&sbi->cp_mutex) an= d blokc_operation(sbi) is called. So unblock_operations should always be called. On =EC=9B=94, 2013-01-28 at 19:03 +0800, majianpeng wrote: > Only !blocked is true,it can call the unblock_operations in func writ= e_checkpoint. >=20 > Signed-off-by: Jianpeng Ma > --- > fs/f2fs/checkpoint.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c > index ff3c843..76308d3 100644 > --- a/fs/f2fs/checkpoint.c > +++ b/fs/f2fs/checkpoint.c > @@ -760,8 +760,10 @@ void write_checkpoint(struct f2fs_sb_info *sbi, = bool blocked, bool is_umount) > /* unlock all the fs_lock[] in do_checkpoint() */ > do_checkpoint(sbi, is_umount); > =20 > - unblock_operations(sbi); > - mutex_unlock(&sbi->cp_mutex); > + if (!blocked) { > + unblock_operations(sbi); > + mutex_unlock(&sbi->cp_mutex); > + } > } > =20 > void init_orphan_info(struct f2fs_sb_info *sbi) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html