mtd/fs/jffs2 debug.h, 1.8, 1.9 nodelist.c, 1.104, 1.105 readinode.c, 1.135, 1.136

Artem Bityuckiy dedekind at infradead.org
Tue Aug 2 06:02:26 EDT 2005


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv2057

Modified Files:
	debug.h nodelist.c readinode.c 
Log Message:
[JFFS2] various minor debugging and formatting fixes

Delete unneeded debugging funcs form the mature and stable functions. They
flood too much.


Index: debug.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/debug.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- debug.h	31 Jul 2005 09:08:38 -0000	1.8
+++ debug.h	2 Aug 2005 10:02:22 -0000	1.9
@@ -19,6 +19,12 @@
 #define CONFIG_JFFS2_FS_DEBUG 0
 #endif
 
+// TODO: remove
+#define JFFS2_DBG_PARANOIA_CHECKS
+#define JFFS2_DBG_READINODE_MESSAGES
+#define JFFS2_DBG_FRAGTREE_MESSAGES
+#define JFFS2_DBG_FRAGTREE2_MESSAGES
+
 #if CONFIG_JFFS2_FS_DEBUG == 1
 /* Enable "paranoia" checks and dumps */
 #define JFFS2_DBG_PARANOIA_CHECKS

Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- nodelist.c	1 Aug 2005 12:05:19 -0000	1.104
+++ nodelist.c	2 Aug 2005 10:02:22 -0000	1.105
@@ -120,7 +120,6 @@
 		parent = *link;
 		base = rb_entry(parent, struct jffs2_node_frag, rb);
 	
-		JFFS2_DBG_FRAGTREE2("considering frag at 0x%08x\n", base->ofs);
 		if (newfrag->ofs > base->ofs)
 			link = &base->rb.rb_right;
 		else if (newfrag->ofs < base->ofs)
@@ -475,7 +474,7 @@
 #endif
 
 	if (crc != tn->data_crc) {
-		JFFS2_NOTICE("drong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
+		JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
 			ofs, tn->data_crc, crc);
 		return 1;
 	}
@@ -975,22 +974,14 @@
 	while(next) {
 		frag = rb_entry(next, struct jffs2_node_frag, rb);
 
-		JFFS2_DBG_FRAGTREE2("considering frag %#04x-%#04x (%p). left %p, right %p\n",
-			  frag->ofs, frag->ofs+frag->size, frag, frag->rb.rb_left, frag->rb.rb_right);
 		if (frag->ofs + frag->size <= offset) {
-			JFFS2_DBG_FRAGTREE2("going right from frag %#04x-%#04x, before the region we care about\n",
-				  frag->ofs, frag->ofs+frag->size);
 			/* Remember the closest smaller match on the way down */
 			if (!prev || frag->ofs > prev->ofs)
 				prev = frag;
 			next = frag->rb.rb_right;
 		} else if (frag->ofs > offset) {
-			JFFS2_DBG_FRAGTREE2("going left from frag %#04x-%#04x, after the region we care about\n",
-				  frag->ofs, frag->ofs+frag->size);
 			next = frag->rb.rb_left;
 		} else {
-			JFFS2_DBG_FRAGTREE2("returning frag %#04x-%#04x, matched\n",
-				  frag->ofs, frag->ofs+frag->size);
 			return frag;
 		}
 	}

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -r1.135 -r1.136
--- readinode.c	1 Aug 2005 12:05:19 -0000	1.135
+++ readinode.c	2 Aug 2005 10:02:23 -0000	1.136
@@ -278,10 +278,11 @@
 
 			/* If we actually calculated the whole data CRC
 			 * and it is wrong, drop the node. */
-			if (unlikely(tn->partial_crc
-			 		!= je32_to_cpu(rd->data_crc)) &&
-				len == csize)
+			if (len == csize && unlikely(tn->partial_crc != je32_to_cpu(rd->data_crc))) {
+				JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",
+					ref_offset(ref), tn->partial_crc, je32_to_cpu(rd->data_crc));
 				goto free_out;
+			}
 
 		} else if (csize == 0) {
 			/*





More information about the linux-mtd-cvs mailing list