From: Craig H. <cr...@gu...> - 2006-03-17 15:47:04
|
I'm actually not 100% sure that this is all that's needed for the new JFFS2 stuff that the kernel knows about but u-boot doesn't. I've seen situations where after heavy use, a JFFS2 rootfs will fail to "fsload" under u-boot on the first invocation. However, if you retry, it works the second time. This appears to be because u-boot scans the entire JFFS2 fs on the first jffs2 command, and builds the FS structure in RAM; subsequent accesses use the in-RAM structure. I think the problem is that after heavy use (including millions of tiny appends to a single large file), the JFFS2 structures are all fragmented and spread around across the flash, with lots of blocks marked "dirty" or however JFFS2 marks them, and u-boot's JFFS2 scanning routine has made some assumptions which break down; it fails to build the filesystem structure in RAM, after getting part way through. Then when it retries, it thinks the structure's already in RAM, so it just uses that, locates the "uImage" file OK, and proceeds. The problem would come if the JFFS2 scan hadn't yet reached the node where uImage is; then the in-RAM structure won't know where uImage is, and the retry too would fail. So far this is just speculation -- I haven't had time to dig into it and see if indeed that is what's going on. And it could be that this is not a problem only with new-JFFS2; it might be a bug which was there before but has only been noticed now. C On Mar 16, 2006, at 2:43 PM, Michael Taylor wrote: > Enjoy. > --- u-boot-1.1.4/fs/jffs2/jffs2_1pass.c 2006-03-15 > 11:27:18.000000000 -0800 > +++ u-boot-1.1.4/fs/jffs2/jffs2_1pass.c 2006-03-15 > 11:26:08.000000000 -0800 > @@ -1194,6 +1194,8 @@ > printf("OOPS Padding has bad size " > "%d < %d\n", node->totlen, > sizeof(struct jffs2_unknown_node)); > + } else if (node->nodetype == 0x2005) { > + // Hide warnings. Node type 2005 is new, but does not > adversely affect u-boot CRC if we leave it off. > } else { > printf("Unknown node type: %x len %d " > "offset 0x%x\n", node->nodetype, |