inode alignment in flash

Finn Hakansson finn.hakansson at
Wed Jul 12 03:16:16 EDT 2000

On Tue, 11 Jul 2000, Rogelio M. Serrano Jr. wrote:

> 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,

To unsubscribe, send "unsubscribe mtd" to majordomo at

More information about the linux-mtd mailing list