]> err.no Git - linux-2.6/blobdiff - fs/jffs2/wbuf.c
[JFFS2] Disable summary after wbuf recovery
[linux-2.6] / fs / jffs2 / wbuf.c
index 58cb77baed8e78e0f35b990dde47332792bfc143..f9da0e755a3ec5b2d7d71adbaa14ad99d774601e 100644 (file)
@@ -238,7 +238,10 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
        jeb = &c->blocks[c->wbuf_ofs / c->sector_size];
 
        spin_lock(&c->erase_completion_lock);
-       jffs2_block_refile(c, jeb, REFILE_NOTEMPTY);
+       if (c->wbuf_ofs % c->mtd->erasesize)
+               jffs2_block_refile(c, jeb, REFILE_NOTEMPTY);
+       else
+               jffs2_block_refile(c, jeb, REFILE_ANYWAY);
        spin_unlock(&c->erase_completion_lock);
 
        BUG_ON(!ref_obsolete(jeb->last_node));
@@ -342,6 +345,9 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
                return;
        }
 
+       /* The summary is not recovered, so it must be disabled for this erase block */
+       jffs2_sum_disable_collecting(c->summary);
+
        ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, nr_refile);
        if (ret) {
                printk(KERN_WARNING "Failed to allocate node refs for wbuf recovery. Data loss ensues.\n");
@@ -988,9 +994,9 @@ int jffs2_check_oob_empty(struct jffs2_sb_info *c,
 
        ret = c->mtd->read_oob(c->mtd, jeb->offset, &ops);
        if (ret || ops.oobretlen != ops.ooblen) {
-               printk(KERN_ERR "cannot read OOB for EB at %08x, requested %"
-                               "bytes, read %d bytes, error %d\n", jeb->offset,
-                               ops.ooblen, ops.oobretlen, ret);
+               printk(KERN_ERR "cannot read OOB for EB at %08x, requested %zd"
+                               " bytes, read %zd bytes, error %d\n",
+                               jeb->offset, ops.ooblen, ops.oobretlen, ret);
                if (!ret)
                        ret = -EIO;
                return ret;
@@ -1031,9 +1037,9 @@ int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c,
 
        ret = c->mtd->read_oob(c->mtd, jeb->offset, &ops);
        if (ret || ops.oobretlen != ops.ooblen) {
-               printk(KERN_ERR "cannot read OOB for EB at %08x, requested %"
-                               "bytes, read %d bytes, error %d\n", jeb->offset,
-                               ops.ooblen, ops.oobretlen, ret);
+               printk(KERN_ERR "cannot read OOB for EB at %08x, requested %zd"
+                               " bytes, read %zd bytes, error %d\n",
+                               jeb->offset, ops.ooblen, ops.oobretlen, ret);
                if (!ret)
                        ret = -EIO;
                return ret;
@@ -1057,9 +1063,9 @@ int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c,
 
        ret = c->mtd->write_oob(c->mtd, jeb->offset, &ops);
        if (ret || ops.oobretlen != ops.ooblen) {
-               printk(KERN_ERR "cannot write OOB for EB at %08x, requested %"
-                               "bytes, read %d bytes, error %d\n", jeb->offset,
-                               ops.ooblen, ops.oobretlen, ret);
+               printk(KERN_ERR "cannot write OOB for EB at %08x, requested %zd"
+                               " bytes, read %zd bytes, error %d\n",
+                               jeb->offset, ops.ooblen, ops.oobretlen, ret);
                if (!ret)
                        ret = -EIO;
                return ret;
@@ -1087,7 +1093,7 @@ int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *
        if (!c->mtd->block_markbad)
                return 1; // What else can we do?
 
-       D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Marking bad block at %08x\n", bad_offset));
+       printk(KERN_WARNING "JFFS2: marking eraseblock at %08x\n as bad", bad_offset);
        ret = c->mtd->block_markbad(c->mtd, bad_offset);
 
        if (ret) {