inode alignment in flash
How should the inodes magic number be aligned in flash? On page boundaries? I have been using mkfs.jffs to create a jffs images. But after mounting it successfully after thrashing some chunks, it wont mount the second time i try. I notice that some chunks are discarded as having invalid checksums and that results in severely reduced file sizes. When I went over the sources, I keep on seeing blocks being referred to in the switch construct inside jffs_scan_flash. Magic numbers are then aligned on block boundaries?
To unsubscribe, send "unsubscribe mtd" to [email protected]
Quoted 8 lines · Rogelio M. Serrano Jr.
How should the inodes magic number be aligned in flash? On page boundaries? I have been using mkfs.jffs to create a jffs images. But after mounting it successfully after thrashing some chunks, it wont mount the second time i try. I notice that some chunks are discarded as having invalid checksums and that results in severely reduced file sizes. When I went over the sources, I keep on seeing blocks being referred to in the switch construct inside
jffs_scan_flash. Magic numbers are then aligned on block boundaries?
No, raw inodes in JFFS is not aligned on page boundaries. There is a definition in jffs_fm.h called JFFS_ALIGN_SIZE which is the alignment of all kinds of data on-flash. Currently JFFS_ALIGN_SIZE is set to 4 bytes. (The comments in the switch in jffs_scan_flash about blocks are a little obsolete. Sorry about that.)
Did I get this right? You first create a jffs image with mkfs.jffs which you are able to mount the first time. Then you write some more data to the flash device, while mounted, and everything is fine. When you then mount after doing these writes, it fails. Exactly where does the mount fail? Hmmm... Can you turn on the debug printouts and try to see what is going wrong?
Best regards,
Finn
To unsubscribe, send "unsubscribe mtd" to [email protected]
Quoted 7 lines · Finn Hakansson
No, raw inodes in JFFS is not aligned on page boundaries. There is a definition in
jffs_fm.hcalledJFFS_ALIGN_SIZEwhich is the alignment of all kinds of data on-flash. CurrentlyJFFS_ALIGN_SIZEis set to 4 bytes. (The comments in the switch injffs_scan_flashabout blocks are a little obsolete. Sorry about that.)
I have already noticed that macro before but I had doubts when I came across the comments when I dived deep into the code.
Quoted 10 lines
Did I get this right? You first create a jffs image with mkfs.jffs which you are able to mount the first time. Then you write some more data to the flash device, while mounted, and everything is fine. When you then mount after doing these writes, it fails. Exactly where does the mount fail? Hmmm... Can you turn on the debug printouts and try to see what is going wrong?
Best regards,
Finn
Not quiet. I created a jffs image by using cat. When I mounted it the first time I noticed that some inodes were already being discarded as invlaid . I didnt write anything to it. After a long time and a lot of messages about invalid checksums it successfuly mounts. I cd into the mounted fs and did an "ls -l" in the directory. The file size for one file was wrong. It was the file with the "invalid" inodes. When I unmount and then mount again it simply fails.
Now I looked at the sources and noticed the patch about byteorder.... I applied it and recompiled the kernel and now I can mount with no problems. I cant write on it though, it just fails. I commented out the part that restricts write to 512 and all but still it wont write. I will try turning on debug and post a copy the output.
Thanks.
To unsubscribe, send "unsubscribe mtd" to [email protected]