Data CRC in JFFS2

Ramakrishna Rao Desetti ramakrishnadtv at gmail.com
Tue Jun 25 03:03:12 PDT 2024


Hi,

I have a question about CRC in JFFS2 and request your comments.

JFFS2 keeps various types of nodes in flash. I am looking at
jffs2_raw_inode. There are 3 CRCs in it. The question concerns only data_crc.

My question is what purpose is this specific CRC serving?

In the normal operation, when we are opening a file, all its nodes
are read and their data CRC is checked. Suppose data CRC for a node fails, then
that node is not added to the frag tree but it is reported as a
message on console.
While the console message is useful, its use is limited (e.g., no access to
console.)

Now, when an application is reading the file and it reads the part of the file
covered by the erstwhile CRC failed node, JFFS2 considers it as a hole and
returns zeroes. That means the application is not informed of the file
corruption.
If the application is actually interested in file corruption, it needs to use
its own CRC (see e.g., "END-TO-END ARGUMENTS IN SYSTEM DESIGN", by J.H. Saltzer
et al).

Given this, what purpose is the data CRC serving? Note that its existence also
leads to inefficiency because of the time taken to do CRC check.

Thanks and regards,
Ramakrishna DTV.



More information about the linux-mtd mailing list