From: Chao Yu <chao@kernel.org>
To: "Liuxue (Alice, Euler Dept seven)" <liuxueliu.liu@huawei.com>,
"Yuchao (T)" <yuchao0@huawei.com>
Cc: "linux-f2fs-devel@lists.sourceforge.net"
<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: 答复: [PATCH 1/2] f2fs: fix to skip GC if type in SSA and SIT is inconsistent
Date: Wed, 4 Jul 2018 21:11:12 +0800 [thread overview]
Message-ID: <093a359f-8cbd-c39a-29e6-217f44ee80e5@kernel.org> (raw)
In-Reply-To: <338EFAA49FA38E4D8519CCC6A880ECC0660B1821@nkgeml514-mbx.china.huawei.com>
Hi Xue,
On 2018/7/4 18:46, Liuxue (Alice, Euler Dept seven) wrote:
> Subject: [f2fs-dev] [PATCH 1/2] f2fs: fix to skip GC if type in SSA and SIT is inconsistent
> Date: Thu, 28 Jun 2018 18:25:58 +0800
> From: Chao Yu <yuchao0@huawei.com>
> To: jaegeuk@kernel.org
> CC: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
>
> If segment type in SSA and SIT is inconsistent, we will encounter below BUG_ON during GC, to avoid this panic, let's just skip doing GC on such segment.
>
> The bug is triggered with image reported in below link:
>
> https://bugzilla.kernel.org/show_bug.cgi?id=200223
>
> [ 388.060262] ------------[ cut here ]------------ [ 388.060268] kernel BUG at /home/y00370721/git/devf2fs/gc.c:989!
> [ 388.061172] invalid opcode: 0000 [#1] SMP [ 388.061773] Modules linked in: f2fs(O) bluetooth ecdh_generic xt_tcpudp iptable_filter ip_tables x_tables lp ttm drm_kms_helper drm intel_rapl sb_edac crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel fb_sys_fops ppdev aes_x86_64 syscopyarea crypto_simd sysfillrect parport_pc joydev sysimgblt glue_helper parport cryptd i2c_piix4 serio_raw mac_hid btrfs hid_generic usbhid hid raid6_pq psmouse pata_acpi floppy
> [ 388.064247] CPU: 7 PID: 4151 Comm: f2fs_gc-7:0 Tainted: G O 4.13.0-rc1+ #26
> [ 388.065306] Hardware name: Xen HVM domU, BIOS 4.1.2_115-900.260_ 11/06/2015 [ 388.066058] task: ffff880201583b80 task.stack: ffffc90004d7c000 [ 388.069948] RIP: 0010:do_garbage_collect+0xcc8/0xcd0 [f2fs] [ 388.070766] RSP: 0018:ffffc90004d7fc68 EFLAGS: 00010202 [ 388.071783] RAX: ffff8801ed227000 RBX: 0000000000000001 RCX: ffffea0007b489c0 [ 388.072700] RDX: ffff880000000000 RSI: 0000000000000001 RDI: ffffea0007b489c0 [ 388.073607] RBP: ffffc90004d7fd58 R08: 0000000000000003 R09: ffffea0007b489dc [ 388.074619] R10: 0000000000000000 R11: 0052782ab317138d R12: 0000000000000018 [ 388.075625] R13: 0000000000000018 R14: ffff880211ceb000 R15: ffff880211ceb000 [ 388.076687] FS: 0000000000000000(0000) GS:ffff880214fc0000(0000) knlGS:0000000000000000 [ 388.083277] CS: 0010 DS: 0000
ES: 0000 CR0: 0000000080050033 [ 388.084536] CR2: 0000000000e18c60 CR3: 00000001ecf2e000 CR4: 00000000001406e0 [ 388.085748] Call Trace:
> [ 388.086690] ? find_next_bit+0xb/0x10 [ 388.088091] f2fs_gc+0x1a8/0x9d0 [f2fs] [ 388.088888] ? lock_timer_base+0x7d/0xa0 [ 388.090213] ? try_to_del_timer_sync+0x44/0x60 [ 388.091698] gc_thread_func+0x342/0x4b0 [f2fs] [ 388.092892] ? wait_woken+0x80/0x80 [ 388.094098] kthread+0x109/0x140 [ 388.095010] ? f2fs_gc+0x9d0/0x9d0 [f2fs] [ 388.096043] ? kthread_park+0x60/0x60 [ 388.097281] ret_from_fork+0x25/0x30 [ 388.098401] Code: ff ff 48 83 e8 01 48 89 44 24 58 e9 27 f8 ff ff 48 83 e8 01 e9 78 fc ff ff 48 8d 78 ff e9 17 fb ff ff 48 83 ef 01 e9 4d f4 ff ff <0f> 0b 66 0f 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 [ 388.100864] RIP: do_garbage_collect+0xcc8/0xcd0 [f2fs] RSP: ffffc90004d7fc68 [ 388.101810] ---[ end trace 81c73d6e6b7da61d ]---
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> fs/f2fs/gc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index da2a71eb7ee2..f3a0e2f62ce6 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -986,7 +986,12 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
> goto next;
> sum = page_address(sum_page);
> - f2fs_bug_on(sbi, type != GET_SUM_TYPE((&sum->footer)));
> + if (type != GET_SUM_TYPE((&sum->footer))) {
> + f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent segment (%u) "
> + "type [%d, %d] in SSA and SIT",
> + segno, type, GET_SUM_TYPE((&sum->footer)));
>
> SBI_NEED_FSCK may be writed for checking disk.
Agreed, let me update the patch. :)
Thanks,
>
>
> + goto next;
> + }
> /*
> * this is to avoid deadlock:
> --
> 2.18.0.rc1
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
> .
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
prev parent reply other threads:[~2018-07-04 13:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 10:25 [PATCH 1/2] f2fs: fix to skip GC if type in SSA and SIT is inconsistent Chao Yu
2018-06-28 10:25 ` [PATCH 2/2] f2fs: fix to do sanity check with inline flags Chao Yu
2018-07-07 1:12 ` Jaegeuk Kim
2018-07-07 1:44 ` Chao Yu
2018-07-15 1:53 ` Chao Yu
2018-07-15 3:06 ` Jaegeuk Kim
2018-07-15 3:45 ` Jaegeuk Kim
[not found] ` <42661306-96ae-aa03-7eab-20e68ca76b68@huawei.com>
2018-07-04 10:46 ` 答复: [PATCH 1/2] f2fs: fix to skip GC if type in SSA and SIT is inconsistent Liuxue (Alice, Euler Dept seven)
2018-07-04 13:11 ` Chao Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=093a359f-8cbd-c39a-29e6-217f44ee80e5@kernel.org \
--to=chao@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=liuxueliu.liu@huawei.com \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).