JFFS2 SUMMARY nodes aren't working

Joakim Tjernlund joakim.tjernlund at transmode.se
Mon Mar 26 12:30:53 EDT 2007


On Mon, 2007-03-26 at 17:09 +0200, Joakim Tjernlund wrote:
> On Mon, 2007-03-26 at 09:02 -0500, Josh Boyer wrote:
> > On Mon, 2007-03-26 at 15:16 +0200, Joakim Tjernlund wrote:
> > > On Mon, 2007-03-26 at 07:37 -0500, Josh Boyer wrote:
> > > > On Fri, 2007-03-23 at 18:24 +0100, Joakim Tjernlund wrote: 
> > > > > 
> > > > > I found that an all empty FS took about the same time to mount
> > > > > which I find very strange.
> > > > > 
> > > > > Looking into the code in scan.c I found that even though I have
> > > > > cleanmarkers in all EB:s, JFFS2 still scans the whole EB. Do
> > > > > you really need to scan the whole area after the cleanmarker?
> > > > > Should be enough to only check a few words after the clean marker
> > > > > and if that is 0xffffffff then assume that the EB is clean
> > > > > since it had a valid clean marker at the beginning.
> > > > 
> > > > No,  you can't just read a few words.  On some flash, the cleanmarker
> > > > cannot be marked invalid in place so you still need to scan the rest of
> > > > the block.  Sucks.
> > > 
> > > Not quite true, for the non XIP case you don't read more than
> > > EMPTY_SCAN_SIZE(c->sector_size) before declaring it free.
> > > 
> > > JFFS2 has relied on this behavior in 2.4 and I see no reason to
> > > change that.
> > 
> > Well, yes you're right.  Too early in the morning for me to be emailing.
> > 
> > But now I'm confused.  Are you running with XIP or no?  If not, then you
> > shouldn't be hitting this issue from what I can tell.  The check below
> > the code you quoted earlier explicitly looks to see if the first node
> > found is a cleanmarker and then returns.
> > 
> > I'm confused how you're hitting this issue unless you have XIP turned on
> 
> I don't run XIP, but I use cfi_cmdset_0001 flash driver and that one
> has support for the point/unpoint methods. 
> 
> XIP needs point but point is also an optimization that has
> its own use and cfi_cmdset_0001 enables them by default.
> This means that all users of above flashdriver(Intel flashes)
> will use point if the flash mapping is linear. 
> 

eeh, just to compare I disabled point in scan.c and tested diffrent
buf_size'es and was quite surprised that lowering the size made
mount go much faster, dropped from ~7 to ~2 seconds:

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index b98661a..cb66a1e 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -97,8 +97,10 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
 #ifndef __ECOS
        size_t pointlen;
 
+       c->mtd->point = c->mtd->unpoint = NULL;
        if (c->mtd->point) {
                ret = c->mtd->point (c->mtd, 0, c->mtd->size, &pointlen, &flashbuf);
+
                if (!ret && pointlen < c->mtd->size) {
                        /* Don't muck about if it won't let us point to the whole flash */
                        D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", pointlen));
@@ -115,7 +117,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
                if (jffs2_cleanmarker_oob(c))
                        buf_size = c->sector_size;
                else
-                       buf_size = PAGE_SIZE;
+                       buf_size = PAGE_SIZE/32;
 
                /* Respect kmalloc limitations */
                if (buf_size > 128*1024)





More information about the linux-mtd mailing list