Hi,

I have an update about the first of the bugs, that I reported.

19.08.2016, 20:23, "Alexander Gordeev" <[email protected]>:
> Hi,
>
> I'd also like to report two bugs. I used f2fs-stable branch linux-3.10.y.
> I'm using some proprietary modules also, but in my understanding they 
> shouldn't affect the fs.
>
> 1. I have a Sandisk 16GB microSDHC card, that is quite old and may be at its 
> end of life.
> The bug is produced every time I try to delete any file on it.
>
> [ 28.805413] ------------[ cut here ]------------
> [ 28.810327] WARNING: at 
> /home/alex/work/s2l/amb_S2l_SDK_2.5/SDK2.5/s2l_linux_sdk/ambarella/kernel/linux-3.10/fs/f2fs/segment.c:1103
>  new_curseg+0x330/0x40c [f2fs]()
> [ 28.824971] Modules linked in:
> [ 28.828128] ov4689_mipi(PO) crc32 f2fs xt_tcpudp nf_conntrack_ipv4 
> nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter ip_tables x_tables 
> sd_mod usb_storage scsi_mod mmc_block evdev bcmdhd(O) amb
> arella_crypto gpio_keys pwm_ambarella snd_soc_wm8974_amb spi_slave_ambarella 
> snd_soc_ambarella_i2s snd_soc_ambarella ambarella_eth spi_ambarella of_mdio 
> ambarella_sd cfg80211 rfkill mmc_core ohci_hcd ehc
> i_hcd usbcore ambarella_udc ambarella_input_ir ambarella_input_adc 
> ambdbus(PO) ambtve(PO) ambad(PO) dsplog(PO) iav(PO) snd_soc_amba_board 
> snd_soc_ambdummy snd_soc_core snd_compress regmap_i2c snd_pcm snd
> _page_alloc snd_timer snd soundcore regmap_spi imgproc(PO) hw_timer(PO) 
> vout(PO) dsp(PO) ksz80x1r libphy spidev i2c_dev
> [ 28.891640] CPU: 0 PID: 489 Comm: videoserverd Tainted: P O 3.10.93 #1
> [ 28.899128] [<8001338c>] (unwind_backtrace+0x0/0x12c) from [<80011a0c>] 
> (show_stack+0x10/0x14)
> [ 28.907795] [<80011a0c>] (show_stack+0x10/0x14) from [<8001effc>] 
> (warn_slowpath_common+0x54/0x68)
> [ 28.916777] [<8001effc>] (warn_slowpath_common+0x54/0x68) from [<8001f0ac>] 
> (warn_slowpath_null+0x1c/0x24)
> [ 28.926531] [<8001f0ac>] (warn_slowpath_null+0x1c/0x24) from [<7f51c220>] 
> (new_curseg+0x330/0x40c [f2fs])
> [ 28.936364] [<7f51c220>] (new_curseg+0x330/0x40c [f2fs]) from [<7f51c6f0>] 
> (allocate_segment_by_default+0x230/0x2b4 [f2fs])
> [ 28.947594] [<7f51c6f0>] (allocate_segment_by_default+0x230/0x2b4 [f2fs]) 
> from [<7f51ccc8>] (allocate_data_block+0x2d8/0x3d8 [f2fs])
> [ 28.959624] [<7f51ccc8>] (allocate_data_block+0x2d8/0x3d8 [f2fs]) from 
> [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs])
> [ 28.970374] [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs]) from 
> [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs])
> [ 28.980595] [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs]) from 
> [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs])
> [ 28.991328] [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs]) from 
> [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs])
> [ 29.002072] [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs]) from [<7f50e33c>] 
> (do_garbage_collect+0xa24/0xcdc [f2fs])
> [ 29.012652] [<7f50e33c>] (do_garbage_collect+0xa24/0xcdc [f2fs]) from 
> [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs])
> [ 29.022684] [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs]) from [<7f503e70>] 
> (f2fs_unlink+0x40/0xe8 [f2fs])
> [ 29.032013] [<7f503e70>] (f2fs_unlink+0x40/0xe8 [f2fs]) from [<800ae7f8>] 
> (vfs_unlink+0x78/0x114)
> [ 29.040940] [<800ae7f8>] (vfs_unlink+0x78/0x114) from [<800ae9b0>] 
> (do_unlinkat+0x11c/0x1a8)
> [ 29.049402] [<800ae9b0>] (do_unlinkat+0x11c/0x1a8) from [<8000ecc0>] 
> (ret_fast_syscall+0x0/0x38)
> [ 29.058186] ---[ end trace d249769884543c44 ]---
> [ 29.062825] ------------[ cut here ]------------
> [ 29.067523] WARNING: at 
> /home/alex/work/s2l/amb_S2l_SDK_2.5/SDK2.5/s2l_linux_sdk/ambarella/kernel/linux-3.10/fs/f2fs/segment.c:1142
>  new_curseg+0x3e4/0x40c [f2fs]()
> [ 29.082113] Modules linked in: ov4689_mipi(PO) crc32 f2fs xt_tcpudp 
> nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter 
> ip_tables x_tables sd_mod usb_storage scsi_mod mmc_block e
> vdev bcmdhd(O) ambarella_crypto gpio_keys pwm_ambarella snd_soc_wm8974_amb 
> spi_slave_ambarella snd_soc_ambarella_i2s snd_soc_ambarella ambarella_eth 
> spi_ambarella of_mdio ambarella_sd cfg80211 rfkill mmc
> _core ohci_hcd ehci_hcd usbcore ambarella_udc ambarella_input_ir 
> ambarella_input_adc ambdbus(PO) ambtve(PO) ambad(PO) dsplog(PO) iav(PO) 
> snd_soc_amba_board snd_soc_ambdummy snd_soc_core snd_compress regm
> ap_i2c snd_pcm snd_page_alloc snd_timer snd soundcore regmap_spi imgproc(PO) 
> hw_timer(PO) vout(PO) dsp(PO) ksz80x1r libphy spidev i2c_dev
> [ 29.147142] CPU: 0 PID: 489 Comm: videoserverd Tainted: P W O 3.10.93 #1
> [ 29.154564] [<8001338c>] (unwind_backtrace+0x0/0x12c) from [<80011a0c>] 
> (show_stack+0x10/0x14)
> [ 29.163211] [<80011a0c>] (show_stack+0x10/0x14) from [<8001effc>] 
> (warn_slowpath_common+0x54/0x68)
> [ 29.172184] [<8001effc>] (warn_slowpath_common+0x54/0x68) from [<8001f0ac>] 
> (warn_slowpath_null+0x1c/0x24)
> [ 29.181887] [<8001f0ac>] (warn_slowpath_null+0x1c/0x24) from [<7f51c2d4>] 
> (new_curseg+0x3e4/0x40c [f2fs])
> [ 29.191508] [<7f51c2d4>] (new_curseg+0x3e4/0x40c [f2fs]) from [<7f51c6f0>] 
> (allocate_segment_by_default+0x230/0x2b4 [f2fs])
> [ 29.202785] [<7f51c6f0>] (allocate_segment_by_default+0x230/0x2b4 [f2fs]) 
> from [<7f51ccc8>] (allocate_data_block+0x2d8/0x3d8 [f2fs])
> [ 29.214742] [<7f51ccc8>] (allocate_data_block+0x2d8/0x3d8 [f2fs]) from 
> [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs])
> [ 29.225477] [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs]) from 
> [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs])
> [ 29.235822] [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs]) from 
> [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs])
> [ 29.246575] [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs]) from 
> [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs])
> [ 29.257220] [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs]) from [<7f50e33c>] 
> (do_garbage_collect+0xa24/0xcdc [f2fs])
> [ 29.267850] [<7f50e33c>] (do_garbage_collect+0xa24/0xcdc [f2fs]) from 
> [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs])
> [ 29.277887] [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs]) from [<7f503e70>] 
> (f2fs_unlink+0x40/0xe8 [f2fs])
> [ 29.287127] [<7f503e70>] (f2fs_unlink+0x40/0xe8 [f2fs]) from [<800ae7f8>] 
> (vfs_unlink+0x78/0x114)
> [ 29.296045] [<800ae7f8>] (vfs_unlink+0x78/0x114) from [<800ae9b0>] 
> (do_unlinkat+0x11c/0x1a8)
> [ 29.304504] [<800ae9b0>] (do_unlinkat+0x11c/0x1a8) from [<8000ecc0>] 
> (ret_fast_syscall+0x0/0x38)
> [ 29.313271] ---[ end trace d249769884543c45 ]---
> [ 29.371882] Unable to handle kernel NULL pointer dereference at virtual 
> address 00000000
> [ 29.396142] pgd = 85644000
> [ 29.399051] [00000000] *pgd=0357b831, *pte=00000000, *ppte=00000000
> [ 29.407041] Internal error: Oops: 17 [#1] PREEMPT ARM
> [ 29.412085] Modules linked in: ov4689_mipi(PO) crc32 f2fs xt_tcpudp 
> nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter 
> ip_tables x_tables sd_mod usb_storage scsi_mod mmc_block e
> vdev bcmdhd(O) ambarella_crypto gpio_keys pwm_ambarella snd_soc_wm8974_amb 
> spi_slave_ambarella snd_soc_ambarella_i2s snd_soc_ambarella ambarella_eth 
> spi_ambarella of_mdio ambarella_sd cfg80211 rfkill mmc
> _core ohci_hcd ehci_hcd usbcore ambarella_udc ambarella_input_ir 
> ambarella_input_adc ambdbus(PO) ambtve(PO) ambad(PO) dsplog(PO) iav(PO) 
> snd_soc_amba_board snd_soc_ambdummy snd_soc_core snd_compress regm
> ap_i2c snd_pcm snd_page_alloc snd_timer snd soundcore regmap_spi imgproc(PO) 
> hw_timer(PO) vout(PO) dsp(PO) ksz80x1r libphy spidev i2c_dev
> [ 29.476936] CPU: 0 PID: 489 Comm: videoserverd Tainted: P W O 3.10.93 #1
> [ 29.484309] task: 869fdc80 ti: 83350000 task.ti: 83350000
> [ 29.489728] PC is at update_sit_entry+0xc4/0x250 [f2fs]
> [ 29.494949] LR is at update_sit_entry+0x78/0x250 [f2fs]
> [ 29.500154] pc : [<7f51a74c>] lr : [<7f51a700>] psr: 20060013
> sp : 83351c48 ip : 00000000 fp : 84a0f740
> [ 29.511600] r10: 00000000 r9 : 00001d74 r8 : 00000001
> [ 29.516800] r7 : 00000000 r6 : 00000080 r5 : 859ac2e0 r4 : 857e6800
> [ 29.523301] r3 : 00000007 r2 : 00153fae r1 : 00000000 r0 : 00153fae
> [ 29.529805] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
> [ 29.536914] Control: 10c53c7d Table: 05844059 DAC: 00000015
> [ 29.542639] Process videoserverd (pid: 489, stack limit = 0x83350238)
> [ 29.549054] Stack: (0x83351c48 to 0x83352000)
> [ 29.553394] 1c40: 00000001 857e6800 003b5800 0034c075 00000004 00000001
> [ 29.561547] 1c60: 00000000 83351d38 80550080 7f51baf0 857e6800 86974cd0 
> 86974cd0 7f51ccd8
> [ 29.569701] 1c80: 83351d2c 84a0f740 00000000 84a0f768 0034c075 83351d01 
> 00000000 800d0d94
> [ 29.577853] 1ca0: 00000000 000000f0 60060013 7f5103cc 86455e00 83351d2c 
> 00000004 80550080
> [ 29.586005] 1cc0: 0000010c 83351d01 857e6938 000006b0 857e6800 7f51cf84 
> 83351d01 00000004
> [ 29.594156] 1ce0: 857e6800 00000000 83351d70 80550080 804ce684 000006b0 
> 857e6800 7f51d128
> [ 29.602309] 1d00: 0006b080 00000000 857e6938 7f515560 00000064 8006ddd8 
> 8054b8f4 000006b0
> [ 29.610461] 1d20: 000006b0 0034c075 86390d08 857e6800 00000001 00000411 
> 003b5800 0034c075
> [ 29.618612] 1d40: 80550080 00000000 80550080 857e6800 00000200 857e6a80 
> 861c2333 00000075
> [ 29.626765] 1d60: 857e6800 7f516af0 000006b0 00000001 00000001 00000000 
> 00000000 00000000
> [ 29.634916] 1d80: 00000000 00000000 00000001 00000000 861c2333 80550080 
> 00000000 7f50e33c
> [ 29.643069] 1da0: 00000001 83351e00 83351eb0 00001a28 000006b0 85795a50 
> 83350000 00000000
> [ 29.651220] 1dc0: 000273c0 00000000 00001a2a 805a0840 00000001 861c2000 
> 00000001 83351e8c
> [ 29.659372] 1de0: 0034c000 857e6804 00001a28 83350000 83351e08 000273c0 
> 000003fc 83351e88
> [ 29.667525] 1e00: 84a0f6c0 84a0f7c0 91827364 83351e0c 83351e0c 83351e14 
> 83351e14 000006b0
> [ 29.675676] 1e20: 000006b0 0034c075 00000008 00000400 00000000 857e6800 
> 83351e8c 00000000
> [ 29.683828] 1e40: 00000000 00000000 857e6a80 00000400 00000000 857e6800 
> 83351e8c 7f50e7ec
> [ 29.691979] 1e60: 00000000 ffffffea 00000000 83351ef4 00000000 00000000 
> 00000000 00000000
> [ 29.700131] 1e80: 857e6a50 857e6a60 00001a28 83351e8c 83351e8c 00000000 
> 00000050 00000000
> [ 29.708282] 1ea0: 00000002 84d43950 000000d6 863d83d8 863d83ec 00000004 
> 00000000 00000000
> [ 29.716434] 1ec0: 00000000 00000000 00000000 857e6800 86390568 00000000 
> 857e692c 84d43034
> [ 29.724586] 1ee0: 863dc720 863dc720 01da6a24 7f503e70 863d83c0 80577860 
> 00000000 86390568
> [ 29.732738] 1f00: 863d83c0 00000000 01da9a34 ffffff9c 863d83c0 800ae7f8 
> 01da6a24 000bda58
> [ 29.740890] 1f20: 00000000 00000000 8699e000 800ae9b0 85795a50 863acaa8 
> 6fe7deef 00000004
> [ 29.749042] 1f40: 8699e027 ffffff9c 00000000 86214d50 86390568 00000000 
> 00000002 00000000
> [ 29.757194] 1f60: 00000000 00000000 00000000 00000000 00000000 00000000 
> 57b1c919 3ace5a0f
> [ 29.765346] 1f80: 57b1c919 3ace5a0f 01da9a34 00418a80 7eee3978 0000000a 
> 8000ee44 83350000
> [ 29.773498] 1fa0: 00000000 8000ecc0 01da9a34 00418a80 01da9a34 7eee3838 
> 81b40000 000081b4
> [ 29.781650] 1fc0: 01da9a34 00418a80 7eee3978 0000000a 01da6ef0 01dac120 
> 7eee3978 01da6a24
> [ 29.789802] 1fe0: 76c49a71 7eee382c 76c49a79 76ca6926 800d0030 01da9a34 
> 00000000 00000000
> [ 29.798018] [<7f51a74c>] (update_sit_entry+0xc4/0x250 [f2fs]) from 
> [<7f51baf0>] (refresh_sit_entry+0x1c/0xb8 [f2fs])
> [ 29.808554] [<7f51baf0>] (refresh_sit_entry+0x1c/0xb8 [f2fs]) from 
> [<7f51ccd8>] (allocate_data_block+0x2e8/0x3d8 [f2fs])
> [ 29.819429] [<7f51ccd8>] (allocate_data_block+0x2e8/0x3d8 [f2fs]) from 
> [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs])
> [ 29.830129] [<7f51cf84>] (do_write_page+0x1bc/0x2c8 [f2fs]) from 
> [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs])
> [ 29.840312] [<7f51d128>] (write_node_page+0x3c/0x44 [f2fs]) from 
> [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs])
> [ 29.851017] [<7f515560>] (f2fs_write_node_page+0xec/0x294 [f2fs]) from 
> [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs])
> [ 29.861630] [<7f516af0>] (move_node_page+0xcc/0xf8 [f2fs]) from [<7f50e33c>] 
> (do_garbage_collect+0xa24/0xcdc [f2fs])
> [ 29.872157] [<7f50e33c>] (do_garbage_collect+0xa24/0xcdc [f2fs]) from 
> [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs])
> [ 29.882157] [<7f50e7ec>] (f2fs_gc+0xc8/0x618 [f2fs]) from [<7f503e70>] 
> (f2fs_unlink+0x40/0xe8 [f2fs])
> [ 29.891373] [<7f503e70>] (f2fs_unlink+0x40/0xe8 [f2fs]) from [<800ae7f8>] 
> (vfs_unlink+0x78/0x114)
> [ 29.900231] [<800ae7f8>] (vfs_unlink+0x78/0x114) from [<800ae9b0>] 
> (do_unlinkat+0x11c/0x1a8)
> [ 29.908672] [<800ae9b0>] (do_unlinkat+0x11c/0x1a8) from [<8000ecc0>] 
> (ret_fast_syscall+0x0/0x38)
> [ 29.917434] Code: e2063007 e3a06001 e1a06316 e1a071aa (e7d121aa)
> [ 29.974780] ---[ end trace d249769884543c46 ]---

As you can see, after to warnings goes an oops. I think it was overlooked.
But it makes the most trouble to me. 

I tried to understand what's going on.
It turns out that se->cur_valid_map is NULL in update_sit_entry().
Probably, this is not expected.

I made this patch:

diff --git a/ambarella/kernel/linux-3.10/fs/f2fs/segment.c 
b/ambarella/kernel/linux-3.10/fs/f2fs/segment.c
index 20eb067..767394e 100644
--- a/ambarella/kernel/linux-3.10/fs/f2fs/segment.c
+++ b/ambarella/kernel/linux-3.10/fs/f2fs/segment.c
@@ -872,6 +872,7 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, 
block_t blkaddr, int del)
 
        /* Update valid block bitmap */
        if (del > 0) {
+               f2fs_bug_on(sbi, !se->cur_valid_map);
                if (f2fs_test_and_set_bit(offset, se->cur_valid_map))
                        f2fs_bug_on(sbi, 1);
                if (!f2fs_test_and_set_bit(offset, se->discard_map))

And got this new warning:

[   49.878738] ------------[ cut here ]------------
[   49.913650] WARNING: at 
/home/alex/work/s2l/amb_S2l_SDK_2.5/SDK2.5/s2l_linux_sdk/ambarella/kernel/linux-3.10/fs/f2fs/segment.c:875
 update_sit_entry+0xfc/0x274 [f2fs]()
[   49.956951] Modules linked in: crc32 f2fs ov4689_mipi(PO) xt_tcpudp 
nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack iptable_filter 
ip_tables x_tables sd_mod bcmdhd(O) cfg80v
[   50.047314] CPU: 0 PID: 421 Comm: f2fs_gc-8:0 Tainted: P        W  O 3.10.93 
#1
[   50.066051] [<800128d0>] (unwind_backtrace+0x0/0x118) from [<80011180>] 
(show_stack+0x10/0x14)
[   50.097576] [<80011180>] (show_stack+0x10/0x14) from [<80020200>] 
(warn_slowpath_common+0x4c/0x68)
[   50.117019] [<80020200>] (warn_slowpath_common+0x4c/0x68) from [<800202ac>] 
(warn_slowpath_null+0x18/0x20)
[   50.127578] [<800202ac>] (warn_slowpath_null+0x18/0x20) from [<7f536b08>] 
(update_sit_entry+0xfc/0x274 [f2fs])
[   50.145997] [<7f536b08>] (update_sit_entry+0xfc/0x274 [f2fs]) from 
[<7f538838>] (refresh_sit_entry+0x1c/0xb8 [f2fs])
[   50.157110] [<7f538838>] (refresh_sit_entry+0x1c/0xb8 [f2fs]) from 
[<7f539840>] (allocate_data_block+0x238/0x318 [f2fs])
[   50.170414] [<7f539840>] (allocate_data_block+0x238/0x318 [f2fs]) from 
[<7f539b44>] (do_write_page+0x224/0x270 [f2fs])
[   50.211114] [<7f539b44>] (do_write_page+0x224/0x270 [f2fs]) from 
[<7f539c28>] (write_node_page+0x38/0x40 [f2fs])
[   50.235535] [<7f539c28>] (write_node_page+0x38/0x40 [f2fs]) from 
[<7f5322fc>] (f2fs_write_node_page+0x1f8/0x2e4 [f2fs])
[   50.262378] [<7f5322fc>] (f2fs_write_node_page+0x1f8/0x2e4 [f2fs]) from 
[<7f533a48>] (move_node_page+0xa8/0xe8 [f2fs])
[   50.303626] [<7f533a48>] (move_node_page+0xa8/0xe8 [f2fs]) from [<7f52ac60>] 
(do_garbage_collect+0x3b8/0xbbc [f2fs])
[   50.316456] [<7f52ac60>] (do_garbage_collect+0x3b8/0xbbc [f2fs]) from 
[<7f52b768>] (f2fs_gc+0x304/0x4e8 [f2fs])
[   50.327530] [<7f52b768>] (f2fs_gc+0x304/0x4e8 [f2fs]) from [<7f52bbc0>] 
(gc_thread_func+0x274/0x368 [f2fs])
[   50.340949] [<7f52bbc0>] (gc_thread_func+0x274/0x368 [f2fs]) from 
[<8003eb28>] (kthread+0xa0/0xac)
[   50.350623] [<8003eb28>] (kthread+0xa0/0xac) from [<8000dd60>] 
(ret_from_fork+0x14/0x34)
[   50.359590] ---[ end trace 2e2fd9e8fd78501a ]---

-- 
 Alexander

------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to