sync() takes minutes while erasing

Joakim Tjernlund joakim.tjernlund at transmode.se
Wed Jun 20 10:49:52 EDT 2007


On Wed, 2007-06-20 at 16:21 +0200, Joakim Tjernlund wrote:
> Here we go again :)
> 
> Noticed one again large delays when rebooting and jffs2 is busy
> erasing block via pdflush.
> 
> Can't see where sync() ends up in jffs2, anyone
> know the jffs2(or pdflush) functions involved during a sync?
> 
>  Jocke 

Ok, found the cause:
 jffs2_erase_pending_blocks(c, 0) is called from
 jffs2_write_super() and it hangs until all
 pending erases are complete.

Why do jffs2_write_super() need to call 
jffs2_erase_pending_blocks(c, 0)? Seems like a bad idea to me.

 Jocke



More information about the linux-mtd mailing list