1 diff -urN linux-2.6.19.old/fs/jffs2/build.c linux-2.6.19.dev/fs/jffs2/build.c
2 --- linux-2.6.19.old/fs/jffs2/build.c 2006-11-29 22:57:37.000000000 +0100
3 +++ linux-2.6.19.dev/fs/jffs2/build.c 2006-12-14 03:13:57.000000000 +0100
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.19.old/fs/jffs2/scan.c linux-2.6.19.dev/fs/jffs2/scan.c
23 --- linux-2.6.19.old/fs/jffs2/scan.c 2006-11-29 22:57:37.000000000 +0100
24 +++ linux-2.6.19.dev/fs/jffs2/scan.c 2006-12-14 03:13:57.000000000 +0100
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 */