Skip to contentSkip to conversation

CLEANMARKER!!

DISCUSSION Nikhil 3 participants 4 messages Dec 22, 2005 Memory technology devices (MTD)

lore
Share & tools
lore

Nikhil

author
#0 lore raw

hi all,

I am a bit confused regarding the cleanmarker stuff in JFFS2. I understand that cleanmarker is written to the eraseblock immediately after a successfull erase, which indicates that the block is empty and can be used for writes.

Is there any other situation when the cleanmarker has to be added at the beginning of the eraseblock?

jffs2dump of an image shows the presence of cleanmarker at the beginning of all the eraseblocks (even if the block contains some valid data). why is there a need to write cleanmarker in each erase block while creating image using mkfs.jffs2?

Signature · 5 lines
Thanks & Regards

Nikhil
Project Engineer
NISG, CDAC
#1 lore raw
Quoted 6 lines · Nikhil

hi all,

I am a bit confused regarding the cleanmarker stuff in JFFS2. I understand that cleanmarker is written to the eraseblock immediately after a successfull erase, which indicates that the block is empty and can be used for writes.

Right.

Quoted 2 lines

Is there any other situation when the cleanmarker has to be added at the beginning of the eraseblock?

No, only after erase.

Quoted 4 lines

jffs2dump of an image shows the presence of cleanmarker at the beginning of all the eraseblocks (even if the block contains some valid data). why is there a need to write cleanmarker in each erase block while creating image using mkfs.jffs2?

There is no real need. mkfs.jffs2 just implemented that way. It just tries to be the same as if the same image would be created by means of copying files t oa mounted JFFS2, then dumping /dev/mtdX...

Signature · 3 lines
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
#2 lore raw
Quoted 9 lines · Artem B. Bityutskiy
Quoted 4 lines · Nikhil

jffs2dump of an image shows the presence of cleanmarker at the beginning of all the eraseblocks (even if the block contains some valid data). why is there a need to write cleanmarker in each erase block while creating image using mkfs.jffs2?

There is no real need. mkfs.jffs2 just implemented that way. It just tries to be the same as if the same image would be created by means of copying files t oa mounted JFFS2, then dumping /dev/mtdX...

It's an optimization of mkfs.jffs2. If it didn't write those cleanmarkers in the image, JFFS2 would scan flash, find free eraseblocks, and go erase them again since the cleanmarker is missing.
With the cleanmarkers there, the erase of already erased blocks is
omitted.

josh

#3 lore raw
Quoted 5 lines · Josh Boyer

It's an optimization of mkfs.jffs2. If it didn't write those cleanmarkers in the image, JFFS2 would scan flash, find free eraseblocks, and go erase them again since the cleanmarker is missing.
With the cleanmarkers there, the erase of already erased blocks is
omitted.

Well, this is for empty eraseblocks. Those with data could be devoid of cleanmarkers.

Signature · 3 lines
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.