1 diff -urN linux-2.6.21.1.old/fs/jffs2/build.c linux-2.6.21.1.dev/fs/jffs2/build.c
2 --- linux-2.6.21.1.old/fs/jffs2/build.c 2007-04-27 23:49:26.000000000 +0200
3 +++ linux-2.6.21.1.dev/fs/jffs2/build.c 2007-05-26 20:52:04.425726968 +0200
5 dbg_fsbuild("scanned flash completely\n");
6 jffs2_dbg_dump_block_lists_nolock(c);
8 + if (c->flags & (1 << 7)) {
9 + printk("%s(): unlocking the mtd device... ", __func__);
11 + c->mtd->unlock(c->mtd, 0, c->mtd->size);
14 + printk("%s(): erasing all blocks after the end marker... ", __func__);
15 + jffs2_erase_pending_blocks(c, -1);
19 dbg_fsbuild("pass 1 starting\n");
20 c->flags |= JFFS2_SB_FLAG_BUILDING;
21 /* Now scan the directory tree, increasing nlink according to every dirent found. */
22 diff -urN linux-2.6.21.1.old/fs/jffs2/scan.c linux-2.6.21.1.dev/fs/jffs2/scan.c
23 --- linux-2.6.21.1.old/fs/jffs2/scan.c 2007-04-27 23:49:26.000000000 +0200
24 +++ linux-2.6.21.1.dev/fs/jffs2/scan.c 2007-05-26 20:52:04.491716936 +0200
27 /* reset summary info for next eraseblock scan */
28 jffs2_sum_reset_collected(s);
30 - ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
33 + if (c->flags & (1 << 7))
34 + ret = BLK_STATE_ALLFF;
36 + ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
45 + if ((buf[0] == 0xde) &&
49 + /* end of filesystem. erase everything after this point */
50 + printk("%s(): End of filesystem marker found at 0x%x\n", __func__, jeb->offset);
51 + c->flags |= (1 << 7);
53 + return BLK_STATE_ALLFF;
56 /* We temporarily use 'ofs' as a pointer into the buffer/jeb */