mtd/fs/jffs3 JFFS3design.tex,1.2,1.3

Artem Bityuckiy dedekind at
Sun Jan 23 10:37:18 EST 2005

Update of /home/cvs/mtd/fs/jffs3
In directory

Modified Files:
Log Message:

Index: JFFS3design.tex
RCS file: /home/cvs/mtd/fs/jffs3/JFFS3design.tex,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JFFS3design.tex	22 Jan 2005 14:04:43 -0000	1.2
+++ JFFS3design.tex	23 Jan 2005 15:37:15 -0000	1.3
@@ -7,6 +7,8 @@
@@ -23,8 +25,8 @@
-This document contains different JFFS3 design aspects discussions.
-This document tries to define standard JFFS3 dicitionary and terms.
+This document discusses different JFFS3 design aspects.
+Additionally, this document tries to define standard JFFS3 dicitionary and terms.
@@ -38,61 +40,51 @@
+\large \textbf{Abbrev.} & \large \textbf{Definition} \\[7pt]
-\large \textbf{Abbrev.}
-\large \textbf{Definition}
+\emph{CRC} & Cyclic Redurancy Check \\[4pt]
-Cyclic Redurancy Check
+\emph{JFFS2} & Jouranlling Flash File System version 2 \\[4pt]
-Jouranlling Flash File System version 2
+\emph{JFFS3} & Jouranlling Flash File System version 3 \\[4pt]
-Jouranlling Flash File System version 3
+\emph{MTD} & Memory Technology Device \\[4pt]
-\large \textbf{Term}
-\large \textbf{Definition}
+\large \textbf{Term} & \large \textbf{Definition}
-\raggedright \emph{Block, Sector} 
+\raggedright \emph{Block, Sector}
-The minimal flash erasable unit. \\[4pt]
+The minimal flash erasable unit.
 \raggedright \emph{Eblock}
 JFFS3 may treat several sectors as one eblock. Thus, the minimal
 erasable flash unit from the JFFS3's viewpoint is eblock which consists
-of one or more flash blocks. \\[4pt]
+of one or more flash blocks.
-\raggedright \emph{Node} 
+\raggedright \emph{Node}
 Basic JFFS3 data structure - anything which JFFS3 stores on flash is
-stored in form of node. There are different types of nodes defined.
+stored in form of nodes. There are different types of nodes defined.
 Nodes have standard layout - common header, header and
 data. Common header is the same for any node type. Header and
 data sections are different for different node types.
-\raggedright \emph{Node common header} 
+\raggedright \emph{Node common header}
 Any node begins with common header which contains node magic
 bitmask, node lenght and node type.
@@ -122,7 +114,7 @@
 Each JFFS3 directory entry is represented by the direntry node.
 Direntry nodes are \texttt{struct jffs3\_raw\_dirent} objects.
@@ -137,7 +129,7 @@
-JFFS3 protects all nodes by checksums.
+JFFS3 protects nodes by checksums.
 In order to be able to work with different node sections (common header,
 header, data) independently, each node section has its own checksum.
@@ -152,7 +144,7 @@
 \item NAND technology implies bits flipping, but this is very rare
 phenomena either;
-\item AG-AND flash chips impliy rare bit fliping in block if another block
+\item AG-AND flash chips impliy rare bit fliping in a block if another block
 from a specific block group is erased;
 \item etc.
@@ -163,19 +155,97 @@
 reboot may happen any time and partially written nodes may
 appear on the flash). JFFS2 treats any checksum error as an error caused by
 unclean reboots and have no general ability to distinguish between
-checksum errors due to physical flash corruptiona and due to unclean
+checksum errors due to physical flash corruptions and due to unclean
-In general, in JFFS3 checksum is not intended to detect errors cased by unclean
-reboots. There is another mechanism exists for this purpose. 
+In general, in JFFS3 checksums are not intended (but still may be used) to detect
+errors cased by unclean reboots. There is another mechanism exists for this purpose. 
+% Checksum modes
 \subsection{Checksum modes}
-Two JFFS3 working modes are defined:
+Two JFFS3 checksum working modes are defined and
+depending on the file type and device's goal, one of them is used.
-\item strict mode;
-\item relaxed mode;
+\item \emph{Strict mode} - JFFS3 writes and always checks node's
+checksums. For example, it makes sense to use this checksum mode for sensitive files
+like system libraries or if for different reasons if it is needed to
+detect errors as early as possible.
+\item \emph{Relaxed mode} - JFFS3 writes, but does not check
+checsums when nodes are being read. It makes sense to use this mode on
+very reliable flashes like NOR.
+Note, if flash is additionally protected by ECC at lower (MTD
+[\ref{ref_MTD}]) layer (i.e. NAND, AG-AND or ECC'd NOR chips),
+JFFS3 checks checksums if
+ECC failure was detected even in relaxed checksum mode.
+The checksum mode may be setup on per-file basis using extended file
+attributes. The default checksum mode is configured at
+compilation time.
+% Checksum algorithm
+\subsection{Checksum algorithm}
+The JFFS3 checkum algorism is the pending issue. There was long
+discussion how to calculate checksum. See MTD-mailing list archives:
+and January\\
+Special test was written to measure different checksum algoritm's
+performance. It is wanted to run this test on different platforms.
+Currently only x86 and ARM results are known.
+The test and x86/ARM results may be found at \\
+The test is
+implemented as the kernel loadable module. If you have possibility to run it on your
+platform, please do it and provide results. MIPS, ARM and PPC platforms
+are of special interest. Any suggestions are welcomed.
+\subsubsection*{JFFS2 correspondence}
+JFFS2 uses the CRC32 algoritm with 
+This subsection contains just the gathered list of different ideas and thoughts,
+suggested by different people but have not yet highlited/used in this
+document. Many of some of them may be quite good.
+\item Have some global or per-inode flag telling that there was a CRC
+error detected. In this flag is set, print big warning saying that flash
+device in not reliable anymore. Should be controlled by user, though
+(may be using xattr).
+\item Ask zlib not to generate adler32 checksum. JFFS3 write
+checksums itself.\\
+\item Make the compression selectable per-file (may be using xattr). 
+\item Make one more compression mode when checksums are neither
+generated nor checked.
+\item \raggedright \label{ref_MTD}
+Memory Technology Device (MTD) Subsystem for Linux,

More information about the linux-mtd-cvs mailing list