sync() takes minutes while erasing

Josh Boyer jwboyer at linux.vnet.ibm.com
Wed Jun 20 12:09:04 EDT 2007


On Wed, 2007-06-20 at 16:49 +0200, Joakim Tjernlund wrote:
> 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.

jffs2_write_super is called during unmount.  If there are blocks pending
on the erase list, it's better to erase those now before the unmount is
completed.  Saves some time on the next mount.

josh




More information about the linux-mtd mailing list