最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【问题】jffs2_scan_inode_node(): Data CRC failed on node at … Read … calculated …

工作和技术 crifan 5240浏览 0评论

【问题】jffs2_scan_inode_node(): Data CRC failed on node at … Read … calculated …
Empty flash at …
之前用jffs2的时候,就遇到过此问题,但是一直没有搞懂具体的原因。
今天去google了一下,找到一些解释,说的应该是比较清楚了,
现摘录如下:

1.
http://www.infradead.org/pipermail/linux-mtd/2004-May/009725.html

"I have had similar problems to this. As you reboot you must make sure that root is
remounted read only. If you don’t a reboot can cause the JFFS2 garbage collector to
be stopped mid operation. JFFS2 is verbose in error reporting. I suspect that your
files are still ok. There was a bug in the JFFS2 layer which caused the garbage
collector not to flush it’s write buffer on remount read only. This would not screw up
the filesystem but it would generate messages for uncleanly finished garbage
operations. I have discussed this recently and it should be available via CVS now.

I have had discussions about the empty flash messages too. It seems it is not a
problem. If the message concerns you move it to KERN_DEBUG
"
2.
http://lists.infradead.org/pipermail/linux-mtd/2003-January/006861.html
"
Nothing’s corrupted. It’s probably because the machine was powered off or
rebooted while it was busy garbage-collecting. As it writes out new
replacement nodes before the old ones are marked obsolete, if you interrupt
it, it means that the original node will have remained intact on the flash
— only the new node which was _going_ to replace it is broken, and that’s
part of what the CRC check is there for.

It’ll go away in time when the block in which the offending node resides is
garbage collected.
"

3.这里有详细的讨论,可以貌似后面的偶看不懂,没看出是否有提供什么好方法了:

  • CRC error after power off, Tino Keitel
  • 总结一下就是,估计是在写操作(比如,jffs2垃圾回收过程)中,你正好关机或重启了,
    使得Jffs2中,新的节点,要写入的节点,没来得及写入flash,就丢失了。
    而旧的节点,由于没有被标记为“废弃的”,所以,每次系统启动去检查这些数据,
    就会校验错误。

    【解决办法】
    声明,我自己并没去实现过。只不过想到这样做,也许是可以的。
    既然知道了,这个不是错误,对使用没啥影响,
    那么一个很弱智的办法就是,去源码里面,把此警告注释掉。。。
    此外,最好的办法,也就只能等对JFFS2垃圾回收机制清楚的人,去及时解决此bug,
    更新源码了。。。

    转载请注明:在路上 » 【问题】jffs2_scan_inode_node(): Data CRC failed on node at … Read … calculated …

    发表我的评论
    取消评论

    表情

    Hi,您需要填写昵称和邮箱!

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址

    网友最新评论 (2)

    1. 回复tang_dy:应该就是前面给出链接的帖子中说的,估计是jffs2还没有把数据写完,你就断电重启了,所以会出现此警告。
      解决办法,目前没有合适的。从原理上说,只要保证你关机的时候,jffs2的写操作已经完成了,比如保证其垃圾回收机制没有正在运行,这时你再umount你的jffs2,再关机,应该就不会出现这个问题了。但是作为rootfs,好像没法直接umount,所以,没有好办法。详情自己去那那些对话,也许对你有帮助。
      againinput416年前 (2009-07-29)回复
    2. 问下你:
      我在内核启动后就挂载jffs2到/mnt目录,然后用fopen和fwrite在/mnt目录新建一文件,然后reboot,提示“jffs2_scan_dirent_node(): Name CRC failed on node at 0x000c03f0: Read 0xbb49”,在mnt目录下新建的文件也没有了。
      是什么原因?
      直接拷贝一个文件到mnt目录,和在mnt目录下新建文件夹,重启后都是ok,其文件和目录都没丢失。
      tang_dy16年前 (2009-07-28)回复
    82 queries in 0.197 seconds, using 22.11MB memory