]> err.no Git - linux-2.6/blobdiff - fs/jffs2/summary.c
[JFFS2] Correct handling of JFFS2_FEATURE_RWCOMPAT_COPY nodes.
[linux-2.6] / fs / jffs2 / summary.c
index 912189762323a5c35f74f8bfb1e076faea017d7a..53a84b468cfe223a38f669a1e4168d600ecc43ed 100644 (file)
@@ -617,11 +617,11 @@ int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb
                if (je32_to_cpu(summary->cln_mkr) != c->cleanmarker_size) {
                        dbg_summary("CLEANMARKER node has totlen 0x%x != normal 0x%x\n",
                                je32_to_cpu(summary->cln_mkr), c->cleanmarker_size);
-                       UNCHECKED_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
+                       DIRTY_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
                } else if (jeb->first_node) {
                        dbg_summary("CLEANMARKER node not first node in block "
                                        "(0x%08x)\n", jeb->offset);
-                       UNCHECKED_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
+                       DIRTY_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
                } else {
                        struct jffs2_raw_node_ref *marker_ref = jffs2_alloc_raw_node_ref();
 
@@ -760,7 +760,14 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
                        }
 #endif
                        default : {
-                               BUG();  /* unknown node in summary information */
+                               if ((je16_to_cpu(temp->u.nodetype) & JFFS2_COMPAT_MASK)
+                                   == JFFS2_FEATURE_RWCOMPAT_COPY) {
+                                       dbg_summary("Writing unknown RWCOMPAT_COPY node type %x\n",
+                                                   je16_to_cpu(temp->u.nodetype));
+                                       jffs2_sum_disable_collecting(c->summary);
+                               } else {
+                                       BUG();  /* unknown node in summary information */
+                               }
                        }
                }
 
@@ -800,7 +807,7 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
                        infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);
 
                c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
-               WASTED_SPACE(infosize);
+               DIRTY_SPACE(infosize);
 
                return 1;
        }