f2fs corruption due to f2fs_gc crash.
Hello,
I am running a system with a microSD card, on the top of which a dmcrypt luks is used, and f2fs on that.
Every time I boot my system, fsck takes a fair amount of time to fix the filesystem. Shortly after boot I can spot a f2fs_gc crash (I suppose it's crash) in the kernel log.
[ 0.000000] CPU: 4 PID: 2286 Comm: f2fs_gc-253:6 Not tainted 4.9.4 #1 [ 0.000000] Hardware name: LENOVO 20AUA1FFPB/20AUA1FFPB, BIOS J4ET87WW(1.87) 09/21/2016 [ 0.000000] 0000000000000000 ffffffff81452dd9 0000000000000000 0000000000000000 [ 0.000000] ffffffff810b1099 0000000000000000 ffffc90005113da0 0000000000000007 [ 0.000000] 0000000000000006 0000000000000006 ffff880213bc8000 ffffffff813ef8a3 [ 0.000000] Call Trace: [ 0.000000] [<ffffffff81452dd9>] ? dump_stack+0x46/0x5d [ 0.000000] [<ffffffff810b1099>] ? __warn+0xb9/0xe0 [ 0.000000] [<ffffffff813ef8a3>] ? do_garbage_collect+0xb03/0xbe0 [ 0.000000] [<ffffffff810e184b>] ? dequeue_task_fair+0x5ab/0x1300 [ 0.000000] [<ffffffff813efc1f>] ? f2fs_gc+0x15f/0x4b0 [ 0.000000] [<ffffffff813f01f7>] ? gc_thread_func+0x287/0x360 [ 0.000000] [<ffffffff8181cc63>] ? __schedule+0x173/0x5f0 [ 0.000000] [<ffffffff810ea2c0>] ? wake_atomic_t_function+0x50/0x50 [ 0.000000] [<ffffffff813eff70>] ? f2fs_gc+0x4b0/0x4b0 [ 0.000000] [<ffffffff810b558e>] ? do_group_exit+0x2e/0xa0 [ 0.000000] [<ffffffff810ccf39>] ? kthread+0xb9/0xd0 [ 0.000000] [<ffffffff810cce80>] ? kthread_park+0x50/0x50 [ 0.000000] [<ffffffff81820b12>] ? ret_from_fork+0x22/0x30 [ 0.000000] ---[ end trace c7ec9ea0d14d95b3 ]--- [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: CPU: 0 PID: 2286 at fs/f2fs/gc.c:866 do_garbage_collect+0xb03/0xbe0 [ 0.000000] Modules linked in: ctr ccm algif_skcipher af_alg
ipt_MASQUERADE iptable_nat mmc_block arc4 rtsx_pci_sdmmc mmc_core snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic iwlmvm mac80211 snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer iwlwifi cfg80211 rtsx_pci mfd_core coretemp kvm_intel thinkpad_acpi snd soundcore rfkill
[ 0.000000] CPU: 0 PID: 2286 Comm: f2fs_gc-253:6 Tainted: G W
4.9.4 #1
[ 0.000000] Hardware name: LENOVO 20AUA1FFPB/20AUA1FFPB, BIOS
J4ET87WW(1.87) 09/21/2016
[ 0.000000] 0000000000000000 ffffffff81452dd9 0000000000000000
0000000000000000
[ 0.000000] ffffffff810b1099 0000000000000000 ffffc90005113da0
0000000000000008
[ 0.000000] 0000000000000007 0000000000000007 ffff880213bc8000
ffffffff813ef8a3
[ 0.000000] Call Trace:
[ 0.000000] [<ffffffff81452dd9>] ? dump_stack+0x46/0x5d
[ 0.000000] [<ffffffff810b1099>] ? __warn+0xb9/0xe0
[ 0.000000] [<ffffffff813ef8a3>] ? do_garbage_collect+0xb03/0xbe0
[ 0.000000] [<ffffffff810e184b>] ? dequeue_task_fair+0x5ab/0x1300
[ 0.000000] [<ffffffff813efc1f>] ? f2fs_gc+0x15f/0x4b0
[ 0.000000] [<ffffffff813f01f7>] ? gc_thread_func+0x287/0x360
[ 0.000000] [<ffffffff8181cc63>] ? __schedule+0x173/0x5f0
[ 0.000000] [<ffffffff810ea2c0>] ? wake_atomic_t_function+0x50/0x50
[ 0.000000] [<ffffffff813eff70>] ? f2fs_gc+0x4b0/0x4b0
[ 0.000000] [<ffffffff810b558e>] ? do_group_exit+0x2e/0xa0
[ 0.000000] [<ffffffff810ccf39>] ? kthread+0xb9/0xd0
[ 0.000000] [<ffffffff810cce80>] ? kthread_park+0x50/0x50
[ 0.000000] [<ffffffff81820b12>] ? ret_from_fork+0x22/0x30
[ 0.000000] ---[ end trace c7ec9ea0d14d95b4 ]---I had this on kernel 4.8 and 4.9. I have another system, where I also use f2fs over dmcrypt, but on ssd not microSD card and I see no problem there. Could you please comment on this?
-- Piotr.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Hello,
Quoted 69 lines · KARBOWSKI Piotr
Hello,
I am running a system with a microSD card, on the top of which a dmcrypt luks is used, and f2fs on that.
Every time I boot my system, fsck takes a fair amount of time to fix the filesystem. Shortly after boot I can spot a
f2fs_gccrash (I suppose it's crash) in the kernel log.[ 0.000000] CPU: 4 PID: 2286 Comm: f2fs_gc-253:6 Not tainted 4.9.4 #1 [ 0.000000] Hardware name: LENOVO 20AUA1FFPB/20AUA1FFPB, BIOS J4ET87WW(1.87) 09/21/2016 [ 0.000000] 0000000000000000 ffffffff81452dd9 0000000000000000 0000000000000000 [ 0.000000] ffffffff810b1099 0000000000000000 ffffc90005113da0 0000000000000007 [ 0.000000] 0000000000000006 0000000000000006 ffff880213bc8000 ffffffff813ef8a3 [ 0.000000] Call Trace: [ 0.000000] [<ffffffff81452dd9>] ? dump_stack+0x46/0x5d [ 0.000000] [<ffffffff810b1099>] ? __warn+0xb9/0xe0 [ 0.000000] [<ffffffff813ef8a3>] ? do_garbage_collect+0xb03/0xbe0 [ 0.000000] [<ffffffff810e184b>] ? dequeue_task_fair+0x5ab/0x1300 [ 0.000000] [<ffffffff813efc1f>] ? f2fs_gc+0x15f/0x4b0 [ 0.000000] [<ffffffff813f01f7>] ? gc_thread_func+0x287/0x360 [ 0.000000] [<ffffffff8181cc63>] ? __schedule+0x173/0x5f0 [ 0.000000] [<ffffffff810ea2c0>] ? wake_atomic_t_function+0x50/0x50 [ 0.000000] [<ffffffff813eff70>] ? f2fs_gc+0x4b0/0x4b0 [ 0.000000] [<ffffffff810b558e>] ? do_group_exit+0x2e/0xa0 [ 0.000000] [<ffffffff810ccf39>] ? kthread+0xb9/0xd0 [ 0.000000] [<ffffffff810cce80>] ? kthread_park+0x50/0x50 [ 0.000000] [<ffffffff81820b12>] ? ret_from_fork+0x22/0x30 [ 0.000000] ---[ end trace c7ec9ea0d14d95b3 ]--- [ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: CPU: 0 PID: 2286 at fs/f2fs/gc.c:866 do_garbage_collect+0xb03/0xbe0 [ 0.000000] Modules linked in: ctr ccm algif_skcipher af_alg
ipt_MASQUERADEiptable_natmmc_blockarc4rtsx_pci_sdmmcmmc_coresnd_hda_codec_hdmisnd_hda_codec_realteksnd_hda_codec_genericiwlmvm mac80211snd_hda_intelsnd_hda_codecsnd_hwdepsnd_hda_coresnd_pcmsnd_timeriwlwifi cfg80211rtsx_pcimfd_corecoretempkvm_intelthinkpad_acpisnd soundcore rfkill[ 0.000000] CPU: 0 PID: 2286 Comm: f2fs_gc-253:6 Tainted: G W 4.9.4 #1 [ 0.000000] Hardware name: LENOVO 20AUA1FFPB/20AUA1FFPB, BIOS J4ET87WW(1.87) 09/21/2016 [ 0.000000] 0000000000000000 ffffffff81452dd9 0000000000000000 0000000000000000 [ 0.000000] ffffffff810b1099 0000000000000000 ffffc90005113da0 0000000000000008 [ 0.000000] 0000000000000007 0000000000000007 ffff880213bc8000 ffffffff813ef8a3 [ 0.000000] Call Trace: [ 0.000000] [<ffffffff81452dd9>] ? dump_stack+0x46/0x5d [ 0.000000] [<ffffffff810b1099>] ? __warn+0xb9/0xe0 [ 0.000000] [<ffffffff813ef8a3>] ? do_garbage_collect+0xb03/0xbe0 [ 0.000000] [<ffffffff810e184b>] ? dequeue_task_fair+0x5ab/0x1300 [ 0.000000] [<ffffffff813efc1f>] ? f2fs_gc+0x15f/0x4b0 [ 0.000000] [<ffffffff813f01f7>] ? gc_thread_func+0x287/0x360 [ 0.000000] [<ffffffff8181cc63>] ? __schedule+0x173/0x5f0 [ 0.000000] [<ffffffff810ea2c0>] ? wake_atomic_t_function+0x50/0x50 [ 0.000000] [<ffffffff813eff70>] ? f2fs_gc+0x4b0/0x4b0 [ 0.000000] [<ffffffff810b558e>] ? do_group_exit+0x2e/0xa0 [ 0.000000] [<ffffffff810ccf39>] ? kthread+0xb9/0xd0 [ 0.000000] [<ffffffff810cce80>] ? kthread_park+0x50/0x50 [ 0.000000] [<ffffffff81820b12>] ? ret_from_fork+0x22/0x30 [ 0.000000] ---[ end trace c7ec9ea0d14d95b4 ]---
Quoted 3 lines
I had this on kernel 4.8 and 4.9. I have another system, where I also use f2fs over dmcrypt, but on ssd not microSD card and I see no problem there. Could you please comment on this?
Thank you for the report.
If possible, could you share the fsck log whether it repaired something? That message is caused by wrong summary type, which is able to be fixed by fsck.
Thanks,
Quoted 10 lines
-- Piotr.
------------------------------------------------------------------------------
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 [email protected]
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
Hi,
Quoted 3 lines · Jaegeuk Kim
If possible, could you share the fsck log whether it repaired something? That message is caused by wrong summary type, which is able to be fixed by fsck.
Yes, of course. Please find the log below.
+ fsck.f2fs -a /dev/mapper/sd_stash
Info: Fix the reported corruption.
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 384497664 (187743 MB)
Info: MKFS version
"Linux version 4.8.9-frontier1 (root@kurogane) (gcc version 5.4.0
(Gentoo 5.4.0 p1.0, pie-0.6.5) ) #5 SMP Mon Dec 19 16:57:47 CET 2016"
Info: FSCK version
from "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
to "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 384497664 (187743 MB)
Info: CKPT version = dac
Info: checkpoint state = 51 : fsck unmount
[FSCK] Unreachable nat entries [Ok..] [0x0] [FSCK] SIT valid block bitmap checking [Ok..] [FSCK] Hard link checking for regular file [Ok..] [0x7] [FSCK] valid_block_count matching with CP [Ok..] [0x1f34b71] [FSCK] valid_node_count matcing with CP (de lookup) [Ok..] [0x9aef] [FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x9aef] [FSCK] valid_inode_count matched with CP [Ok..] [0x1260] [FSCK] free segment_count matched with CP [Ok..] [0x73d3] [FSCK] next block offset is free [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Ok..]
Done.
+ mount LABEL=sd_stash
-- Piotr.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Quoted 8 lines · KARBOWSKI Piotr
Hi,
Quoted 3 lines · Jaegeuk Kim
If possible, could you share the fsck log whether it repaired something? That message is caused by wrong summary type, which is able to be fixed by fsck.
Yes, of course. Please find the log below.
Hi,
Quoted 12 lines
+ fsck.f2fs -a
/dev/mapper/sd_stash
Info: Fix the reported corruption.
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 384497664 (187743 MB)
Info: MKFS version
"Linux version 4.8.9-frontier1 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0 p1.0, pie-0.6.5) ) #5 SMP Mon Dec 19 16:57:47 CET 2016"
Info: FSCK version
from "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
Quoted 8 lines
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
to "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 384497664 (187743 MB)
Info: CKPT version = dac
Info: checkpoint state = 51 : fsck unmount
So, it shows fsck, which means there were IO errors given by sd card. How about using the latest f2fs-tools/dev-test?
http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/log/?h=dev-test
Thanks,
Quoted 10 lines
[FSCK] Unreachable nat entries [Ok..] [0x0] [FSCK] SIT valid block bitmap checking [Ok..] [FSCK] Hard link checking for regular file [Ok..] [0x7] [FSCK] valid_block_count matching with CP [Ok..] [0x1f34b71] [FSCK] valid_node_count matcing with CP (de lookup) [Ok..] [0x9aef] [FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x9aef] [FSCK] valid_inode_count matched with CP [Ok..] [0x1260] [FSCK] free segment_count matched with CP [Ok..] [0x73d3] [FSCK] next block offset is free [Ok..]
Quoted 7 lines
[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Ok..]Done.
+ mount LABEL=sd_stash-- Piotr.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Hi,
Quoted 4 lines · Jaegeuk Kim
So, it shows fsck, which means there were IO errors given by sd card. How about using the latest f2fs-tools/dev-test?
http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/log/?h=dev-test
Here's the output:
kurogane f2fs-tools [dev-test] # umount /dev/mapper/sd_stash kurogane f2fs-tools [dev-test] # ./fsck/fsck.f2fs -a /dev/mapper/sd_stash
Info: Fix the reported corruption.
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 384497664 (187743 MB)
Info: MKFS version
"Linux version 4.8.9-frontier1 (root@kurogane) (gcc version 5.4.0
(Gentoo 5.4.0 p1.0, pie-0.6.5) ) #5 SMP Mon Dec 19 16:57:47 CET 2016"
Info: FSCK version
from "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
to "Linux version 4.9.4 (root@kurogane) (gcc version 5.4.0 (Gentoo
5.4.0-r2 p1.2, pie-0.6.5) ) #1 SMP Wed Jan 18 23:38:00 CET 2017"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 384497664 (187743 MB)
Info: CKPT version = e00
Info: checkpoint state = 51 : fsck unmount
[FSCK] Unreachable nat entries [Ok..] [0x0] [FSCK] SIT valid block bitmap checking [Ok..] [FSCK] Hard link checking for regular file [Ok..] [0x6] [FSCK] valid_block_count matching with CP [Ok..] [0x1f2dbe1] [FSCK] valid_node_count matcing with CP (de lookup) [Ok..] [0x9abe] [FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x9abe] [FSCK] valid_inode_count matched with CP [Ok..] [0x1251] [FSCK] free segment_count matched with CP [Ok..] [0x740a] [FSCK] next block offset is free [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Ok..]
Done.
-- Piotr.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot