Hello.

We have a Xscale based board with NOR flash storage. We are working on
ways to detect and recover from file corruption and some questions
were raised as a consequence of that:

1- Does JFFS2 do some kind of wear leveling?
2- If the answer to 1 above is yes, what is the basic algorithm? AFAIR
one possible algorithm uses only free blocks for wear leveling; thus
blocks that keep unmodified files (that is, files in FS that are only
read) are left alone. Other possible algorithm uses every block for
wear leveling and copies blocks from unmodified files to other blocks
so that every block in the flash is evenly used in order to increase
its lifespan.
3- If the answer to 1 is no, is some kind of wear leveling done at
all?

I tried to figure out from documentation on MTD site but I couldn't. I
mean, it was not entirely clear which algorithm is used for WL.

Thank you very much in advance for any help.

Elder.