1 Index: linux-2.6.23-rc6/fs/jffs2/build.c
2 ===================================================================
3 --- linux-2.6.23-rc6.orig/fs/jffs2/build.c 2007-09-21 16:23:53.000000000 +0800
4 +++ linux-2.6.23-rc6/fs/jffs2/build.c 2007-09-21 16:24:05.000000000 +0800
6 dbg_fsbuild("scanned flash completely\n");
7 jffs2_dbg_dump_block_lists_nolock(c);
9 + if (c->flags & (1 << 7)) {
10 + printk("%s(): unlocking the mtd device... ", __func__);
12 + c->mtd->unlock(c->mtd, 0, c->mtd->size);
15 + printk("%s(): erasing all blocks after the end marker... ", __func__);
16 + jffs2_erase_pending_blocks(c, -1);
20 dbg_fsbuild("pass 1 starting\n");
21 c->flags |= JFFS2_SB_FLAG_BUILDING;
22 /* Now scan the directory tree, increasing nlink according to every dirent found. */
23 Index: linux-2.6.23-rc6/fs/jffs2/scan.c
24 ===================================================================
25 --- linux-2.6.23-rc6.orig/fs/jffs2/scan.c 2007-09-21 16:23:52.000000000 +0800
26 +++ linux-2.6.23-rc6/fs/jffs2/scan.c 2007-09-21 16:24:05.000000000 +0800
29 /* reset summary info for next eraseblock scan */
30 jffs2_sum_reset_collected(s);
32 - ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
35 + if (c->flags & (1 << 7))
36 + ret = BLK_STATE_ALLFF;
38 + ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset),
47 + if ((buf[0] == 0xde) &&
51 + /* end of filesystem. erase everything after this point */
52 + printk("%s(): End of filesystem marker found at 0x%x\n", __func__, jeb->offset);
53 + c->flags |= (1 << 7);
55 + return BLK_STATE_ALLFF;
58 /* We temporarily use 'ofs' as a pointer into the buffer/jeb */