Received: by 10.223.164.221 with SMTP id h29csp2882628wrb; Thu, 2 Nov 2017 20:30:35 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SkW6wUj3h9ABYdBVYr+MZ+N+3Z/Wf5yZLJe2iK/xXDVWit/uSgnzZcff7s2WbV+F315HvP X-Received: by 10.84.247.129 with SMTP id o1mr5244273pll.6.1509679835136; Thu, 02 Nov 2017 20:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509679835; cv=none; d=google.com; s=arc-20160816; b=XsKzNBvPrE7KsXLaCrM6X/dW6Jpf2eBqMCz4AzSzJqWUrfxA/H7CJN+hCy0q2s3b3K SKX18C7zMiohPP8FKx+yeFeCuYFDv7I4d76GoYcNqyYmIwUgnzQdvxOfln1NvdOtLhLs YQDQLQiZWnA1ydV0jpt2AIiKCSs882GHj15f9AFwMHVp8JTxr5ZDqekCl2mMSmuzUJvy vw+7IwsclqbmWTKQcL2/nsSf4hFJHtGSh5Zq5PX6+gvcOMnVbMx/EFtIIV9ingxZykMg 6u7gosv8ca+6l2jGEZ7H00fH+Bx9stze7h+yGPoeD1NG9Tr8WTNU6nlmCsm+tMhnw7zp Lnaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=k7dCJbaNidnILEADywrM83V/KAWcnU1SSgBPWPCFgnA=; b=puspqzB42szExCm6ddJO0CqrpAwKRCCxR3u/C8ZKMcAjW6JWahU2qoYPmOlgZr0RMY cOID2dYUyIHS5ax5dgxDJ/wJGwG4qLsdo9/voYhEPnQ+0TleiGq0f3yF4PVYRggB44vU A0UE7znlAtZnb5S4ZxHK3SC5q7cIxKHmIYkEvVAHQ1Qfk2LHHXJEUcGmyp0FDVRb5d6v ACI9sFw5vL0frNUQYeY7vZVxibzP708DtVJmozV0oXcTJwHb7i6PrHuho+MzfFafJ55k WsjmRfzVpuRmesjpwdoR/zqaI6SFU9GgcD68LQgDXeX6uXn5hfifwg46MH1eLw52H92F gU0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd7si3431808plb.577.2017.11.02.20.30.21; Thu, 02 Nov 2017 20:30:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965114AbdKCD3v (ORCPT + 97 others); Thu, 2 Nov 2017 23:29:51 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51547 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932734AbdKCD3t (ORCPT ); Thu, 2 Nov 2017 23:29:49 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C4993BFA5FE04; Fri, 3 Nov 2017 11:29:36 +0800 (CST) Received: from [127.0.0.1] (10.111.220.140) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Fri, 3 Nov 2017 11:29:11 +0800 Subject: Re: [PATCH v2] f2fs: add bug_on when f2fs_gc even fails to get one victim To: , , , CC: , , , , References: <1507729864-118702-1-git-send-email-yunlong.song@huawei.com> <1507901500-162168-1-git-send-email-yunlong.song@huawei.com> From: Yunlong Song Message-ID: <661b7977-5588-7917-5fde-edcd98090a07@huawei.com> Date: Fri, 3 Nov 2017 11:28:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1507901500-162168-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.111.220.140] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping... On 2017/10/13 21:31, Yunlong Song wrote: > This can help us to debug on some corner case. > > Signed-off-by: Yunlong Song > Signed-off-by: Chao Yu > --- > fs/f2fs/gc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 197ebf4..2b03202 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -986,6 +986,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, > .ilist = LIST_HEAD_INIT(gc_list.ilist), > .iroot = RADIX_TREE_INIT(GFP_NOFS), > }; > + bool need_fggc = false; > > trace_f2fs_gc_begin(sbi->sb, sync, background, > get_pages(sbi, F2FS_DIRTY_NODES), > @@ -1018,8 +1019,10 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, > if (ret) > goto stop; > } > - if (has_not_enough_free_secs(sbi, 0, 0)) > + if (has_not_enough_free_secs(sbi, 0, 0)) { > gc_type = FG_GC; > + need_fggc = true; > + } > } > > /* f2fs_balance_fs doesn't need to do BG_GC in critical path. */ > @@ -1028,6 +1031,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, > goto stop; > } > if (!__get_victim(sbi, &segno, gc_type)) { > + f2fs_bug_on(sbi, !total_freed && need_fggc); > ret = -ENODATA; > goto stop; > } -- Thanks, Yunlong Song From 1582742523892925399@xxx Tue Oct 31 03:34:54 +0000 2017 X-GM-THRID: 1580969854381445046 X-Gmail-Labels: Inbox,Category Forums