JFFS2: file contents in case of data CRC error

llandre r&d2 at dave-tech.it
Sat Feb 2 11:32:57 EST 2008

> Ahh. The temperature tests. That explains a lot. 
> Probably device worked improperly in the test but test did not turn off
> device when NAND become unworkable. As result JFFS2 did not detect the
> problem of broken CRC on mount but did it on attempt to read the broken
> data and printed error message.
I was told by the customer that before starting the temperature test 
several files have been copied on NAND. During the temperature test the 
processor never accessed these files on NAND. Once the test has been 
completed, the files on NAND have been read back and compared to the 
original ones.

> So JFFS2 performed scan on read - found CRC error in node 
> -> JFFS2 marked node to be obsolete
Sure. This is the code snippet in function jffs2_get_inode_nodes:

if (crc != je32_to_cpu(node.i.data_crc)) {
	printk(KERN_NOTICE "jffs2_get_inode_nodes(): Data CRC failed on 		node
at 0x%08x: Read 0x%08x, calculated 0x%08x\n",
        	ref_offset(ref), je32_to_cpu(node.i.data_crc), crc);
	jffs2_mark_node_obsolete(c, ref);

> -> As result hole in the file has been formed. 
> -> You read 0x0 in the middle of the file.
I can't find the function that, in case of obsolete node, zeroes the 
chunk of data passed to user space. Can you?

> I think nobody considered such tests before. I am not sure if any file
> system may be reliable in such a case with temperature tests.
Hmm ... I don't think the environmental condition may influence JFFS2 
behaviour. The NAND used in the test is industrial grade so it is 
guaranteed by manufacturer that it works in -40/+85 degC range. JFFS2 
clearly does not anything about environment temperature. On the other 
hand I'm wondering if temperature variation caused multiple bit flipping 
in one NAND block that MTD was not able to correct and this led to the 
problem we are talking about.


DAVE Electronics System House - R&D Department
web:   http://www.dave.eu
email: r&d2 at dave-tech.it

More information about the linux-mtd mailing list