Received: by 10.223.164.202 with SMTP id h10csp3071977wrb; Sat, 25 Nov 2017 01:15:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMZHStEJRu3XCFmxiuLcGEcKBmyvwUj+PlOQLq9oOCKlj35ED/4PmOlOO93fQx2W+aDzyZJP X-Received: by 10.98.245.221 with SMTP id b90mr30179007pfm.203.1511601306695; Sat, 25 Nov 2017 01:15:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511601306; cv=none; d=google.com; s=arc-20160816; b=ErJH2ELN3f3AF+CAXQabU1wnmoDnHJOCXcsPDNgXBEejOYAY5ILFHplG05qbChcG6+ /hsFBX+LgPtU6EX07Ke2MPukKbTRZ9WYVMR/GAEyFQHN6iUN+kK1cyMjv9RUpsXNlcs3 yRAfSGylubRBpyw6ftn8Rjtv+QQjPPNcHKO2Oxst2ekD6U5r+msb0yh4ySHDaqnxVT/Q 2pNmhsj7Db93JLW8XyOWUe/KLucYvisW/Ns008gf3KA8DteyGBJ5G8EbJuBAqDzXb8KX rBC4AvA2SWHZXxmMXXChxkX3H9qLsrjJM6VT9I0lkszPVYhGOvm+/6IL79M+6M0ZM40a LZpw== 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=qDt0DtBHQVdoC62iEqpNzaYrVGCcUpKFnxwC9DpOQ2A=; b=QYA/etUP1Ae/IcnPf5hel/6KYGNGk+0guAOwerfzxpmxnEdxMs9rmEDTuEZkHceTxR K5qGsnd6btrouZR6dlGf2MqR3aYPiwb8/yIcfPCNxHAs17c1s2idWH+E/wa/pxqFn3QQ YopWV3sdcdrYv08XWTPTSgYM/T3Y5E9CL+sfY1KbyrbKap40TxQLPAxE8fc1Nj7nLyW4 ZyNE4JjtBsh2vYy19X7tEJ120VOYTURQjdVSvNzwmhmr0Pk2Dq2C3GvLPckXwZKgM/Vj vA9KKPvrZ76KnNnAmVu4/Z8RfMQptACHyJr/pV0T/6qpSPCN9pFDQ38Kin7HZJ7lwAhD vrtA== 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 3si20114380pli.734.2017.11.25.01.14.45; Sat, 25 Nov 2017 01:15:06 -0800 (PST) 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 S1751303AbdKYJNo (ORCPT + 79 others); Sat, 25 Nov 2017 04:13:44 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11026 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbdKYJNk (ORCPT ); Sat, 25 Nov 2017 04:13:40 -0500 Received: from 172.30.72.58 (EHLO DGGEMS412-HUB.china.huawei.com) ([172.30.72.58]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DLO49734; Sat, 25 Nov 2017 17:13:01 +0800 (CST) Received: from [127.0.0.1] (10.111.220.140) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Sat, 25 Nov 2017 17:12:29 +0800 Subject: Re: [PATCH v3 RESEND] f2fs: add bug_on when f2fs_gc even fails to get one victim To: Chao Yu , , , CC: , , , , References: <1510880948-154538-1-git-send-email-yunlong.song@huawei.com> <77657045-2bba-2c31-f668-de6351c3f342@kernel.org> From: Yunlong Song Message-ID: <74b3c52a-0f8d-2d53-668f-f6d149ddb6ea@huawei.com> Date: Sat, 25 Nov 2017 17:12:01 +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: <77657045-2bba-2c31-f668-de6351c3f342@kernel.org> 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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5A19341E.000E,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: 959109e4e0b9aeb5f2a9b594f5f434c4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ok, I have found a panic with this bug_on for generic/027 today: [ 5157.753224] F2FS-fs (loop2): Mounted with checkpoint version = 2e2 generic/027 [ 5168.741251] run fstests generic/027 at 2017-11-25 04:46:40 [ 5189.445989] F2FS-fs (loop3): Found nat_bits in checkpoint [ 5189.510872] F2FS-fs (loop3): Mounted with checkpoint version = 165da00b [ 5250.613849] ------------[ cut here ]------------ [ 5250.616840] kernel BUG at /opt/s00293685/src/kernel/jaegeuk/f2fs/fs/f2fs/gc.c:1038! [ 5250.628467] invalid opcode: 0000 [#1] SMP [ 5250.628467] Modules linked in: [ 5250.628467] CPU: 7 PID: 3173 Comm: xfs_io Not tainted 4.14.0-rc4+ #128 [ 5250.628467] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014 [ 5250.628467] task: ffff880130f2be80 task.stack: ffffc9000acd0000 [ 5250.628467] RIP: 0010:f2fs_gc+0x9da/0xa80 [ 5250.628467] RSP: 0018:ffffc9000acd3b48 EFLAGS: 00000246 [ 5250.628467] RAX: 000000000000001b RBX: ffff880134fa2648 RCX: ffff880134fa2f00 [ 5250.628467] RDX: 0000000000000006 RSI: 0000000000000200 RDI: 0000000000000001 [ 5250.628467] RBP: ffffc9000acd3c38 R08: 000000000000001b R09: 0000000000000001 [ 5250.628467] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 [ 5250.628467] R13: 0000000000000001 R14: ffff880138472000 R15: 0000000000000002 [ 5250.628467] FS: 0000000001666880(0000) GS:ffff88013fdc0000(0000) knlGS:0000000000000000 [ 5250.628467] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5250.628467] CR2: 00000000006ef120 CR3: 0000000130f48000 CR4: 00000000000006e0 [ 5250.628467] Call Trace: [ 5250.628467] f2fs_balance_fs+0x13c/0x1f0 [ 5250.628467] f2fs_create+0x146/0x260 [ 5250.628467] path_openat+0xe31/0x12c0 [ 5250.628467] do_filp_open+0x7e/0xd0 [ 5250.628467] ? kmem_cache_alloc+0x92/0x160 [ 5250.628467] ? getname_flags+0x4f/0x1f0 [ 5250.628467] do_sys_open+0x115/0x1f0 [ 5250.628467] SyS_open+0x1e/0x20 [ 5250.628467] entry_SYSCALL_64_fastpath+0x13/0x94 [ 5250.628467] RIP: 0033:0x4171d0 [ 5250.628467] RSP: 002b:00007fff9a45b678 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 [ 5250.628467] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00000000004171d0 [ 5250.628467] RDX: 0000000000000180 RSI: 0000000000000042 RDI: 00007fff9a45c1cb [ 5250.628467] RBP: 00007fff9a45c1bf R08: 00007fff9a45b7f0 R09: 0000000000000001 [ 5250.628467] R10: 00000000004bd8d3 R11: 0000000000000246 R12: 0000000000000006 [ 5250.628467] R13: 00007fff9a45b830 R14: 0000000000000180 R15: 0000000000000000 [ 5250.628467] Code: 00 bb c3 ff ff ff e9 2c fa ff ff 4d 8b 27 bb fb ff ff ff c7 44 24 7c 00 00 00 00 c7 84 24 80 00 00 00 00 00 00 00 e9 0c fa ff ff <0f> 0b 41 8b 96 fc 03 00 00 41 8b be f4 03 00 00 4c 8b 21 45 8b [ 5250.628467] RIP: f2fs_gc+0x9da/0xa80 RSP: ffffc9000acd3b48 [ 5250.685538] ---[ end trace 00b8c84c59632b32 ]--- Let me fix it one by one. On 2017/11/23 21:05, Chao Yu wrote: > On 2017/11/22 11:50, Yunlong Song wrote: >> ping again... >> >> On 2017/11/17 9:09, Yunlong Song wrote: >>> This can help to find potential bugs on some corner case. > Could you test this patch with fstest suit? if there are any testcases > can trigger this bug_on, it will be better to fix them all together. > > Thanks, > >>> Signed-off-by: Yunlong Song >>> --- >>> fs/f2fs/gc.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c >>> index 5d5bba4..c89128b 100644 >>> --- a/fs/f2fs/gc.c >>> +++ b/fs/f2fs/gc.c >>> @@ -1035,6 +1035,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 && has_not_enough_free_secs(sbi, 0, 0)); >>> ret = -ENODATA; >>> goto stop; >>> } > . > -- Thanks, Yunlong Song From 1584862203689130217@xxx Thu Nov 23 13:06:18 +0000 2017 X-GM-THRID: 1584306437455651366 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread