[LEDE-DEV] flash issue

e9hack e9hack at gmail.com
Sat Jul 23 08:23:39 PDT 2016


Hi,

I did try to find the reason for my problem with jffs2. It seems, it is triggered by
deleting /sysupgrade.tgz by /etc/init.d/done. If I remove the rm -f /sysupgrade.tgz line
completely and delete the file later, I've no issue. I enabled some debug messages and add
a line to /etc/init.d/done to see the time, where rm -f /sysupgrade.tgz will be execute:

[    9.478098] jffs2_scan_eraseblock(): End of filesystem marker found at 0x70000
[    9.485455] jffs2_build_filesystem(): unlocking the mtd device... done.
[    9.492191] jffs2_build_filesystem(): erasing all blocks after the end marker...
jffs2_erase_block(): erase block 0x430000 (range 0x430000-0x440000)
[    9.666422] jffs2_erase_block(): erase block 0x420000 (range 0x420000-0x430000)
[    9.829087] jffs2_erase_block(): erase block 0x410000 (range 0x410000-0x420000)
...
[   19.736767] jffs2_erase_block(): erase block 0x070000 (range 0x070000-0x080000)
[   19.906864] done.
[   19.908852] jffs2: notice: (434) jffs2_build_xattr_subsystem: complete building xattr
subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

user.notice [BOOT: TEST] "------------------------------------------------------------"
[   65.389272] jffs2_erase_block(): erase block 0x000000 (range 0x000000-0x010000)
[   65.670129] jffs2: Newly-erased block contained word 0x19852003 at offset 0x00000000
[   66.146424] jffs2_erase_block(): erase block 0x010000 (range 0x010000-0x020000)
[   67.526861] jffs2_erase_block(): erase block 0x020000 (range 0x020000-0x030000)
[   68.896556] jffs2_erase_block(): erase block 0x030000 (range 0x030000-0x040000)
[   70.172272] jffs2_erase_block(): erase block 0x040000 (range 0x040000-0x050000)
[   71.686421] jffs2_erase_block(): erase block 0x050000 (range 0x050000-0x060000)

At the beginning, all blocks behind the the configuration will be erased. Later
sysupgrade.tgz will be delete. Erasing and checking of block 0 does fail. If I remove the
deleting of sysupgrade.tgz and delete sysupgrade.tgz manually, jffs2_erase_block() message
will be not shown in the log at the time when the file is delete. It starts later or if I
trigger another read/write operation manually. The issue doesn't occur. I put a sleep 15
in front of rm -f /sysupgrade.tgz and let this run in a background thread. I don't get
this error. The log shows:

user.notice [BOOT: TEST] "------------------------------------------------------------"
[   80.312832] jffs2_erase_block(): erase block 0x000000 (range 0x000000-0x010000)
[   80.963137] jffs2_erase_block(): erase block 0x010000 (range 0x010000-0x020000)
[   81.596935] jffs2_erase_block(): erase block 0x020000 (range 0x020000-0x030000)

The erasing of the missing three blocks will be execute later automatically or if I
trigger a write/erase operation again manually. /etc/init.d/done executes afterwards
/etc/rc.locale. I did add some entries, which does force a write operation.

The error is only visible (missing or wrong configuration files), if the router does
reboot again, the delay till the next reboot is not so important. If there is a next flash
update without a reboot in between, the configuration isn't lost, but the same scenario
starts again. After the next reboot, some files are lost or overwritten.

Any idea what goes wrong? Is there a race condition somewhere in the jffs2 driver?

Regards,
Hartmut




More information about the Lede-dev mailing list