mtd/fs/jffs3 debug.c,1.9,1.10 debug.h,1.19,1.20 dir.c,3.6,3.7

Artem Bityuckiy dedekind at infradead.org
Mon Jan 3 13:40:14 EST 2005


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

Modified Files:
	debug.c debug.h dir.c 
Log Message:
Small debug fixes/updates


Index: debug.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/debug.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- debug.c	27 Dec 2004 10:14:08 -0000	1.9
+++ debug.c	3 Jan 2005 18:40:11 -0000	1.10
@@ -65,6 +65,7 @@
 			ERROR_MSG("node_ref %#08x shouldn't be in block at %#08x!\n",
 				ref_offset(ref2), jeb->offset);
 			jffs3_dbg_dump_node_refs(c, jeb);
+			jffs3_dbg_dump_block_lists(c);
 			BUG();
 
 		}
@@ -81,6 +82,7 @@
 					ref_offset(ref2), ref2, ref_offset(ref2->next_phys), ref2->next_phys,
 					ref_offset(jeb->last_node), jeb->last_node);
 			jffs3_dbg_dump_node_refs(c, jeb);
+			jffs3_dbg_dump_block_lists(c);
 			BUG();
 		}
 		ref2 = ref2->next_phys;
@@ -89,18 +91,24 @@
 	if (my_used_size != jeb->used_size) {
 		ERROR_MSG("Calculated used size %#08x != stored used size %#08x\n",
 				my_used_size, jeb->used_size);
+		jffs3_dbg_dump_node_refs(c, jeb);
+		jffs3_dbg_dump_block_lists(c);
 		BUG();
 	}
 
 	if (my_unchecked_size != jeb->unchecked_size) {
 		ERROR_MSG("Calculated unchecked size %#08x != stored unchecked size %#08x\n",
 				my_unchecked_size, jeb->unchecked_size);
+		jffs3_dbg_dump_node_refs(c, jeb);
+		jffs3_dbg_dump_block_lists(c);
 		BUG();
 	}
 
 	if (my_dirty_size != jeb->dirty_size + jeb->wasted_size) {
 		ERROR_MSG("Calculated dirty+wasted size %#08x != stored dirty + wasted size %#08x\n",
 			my_dirty_size, jeb->dirty_size + jeb->wasted_size);
+		jffs3_dbg_dump_node_refs(c, jeb);
+		jffs3_dbg_dump_block_lists(c);
 		BUG();
 	}
 
@@ -110,6 +118,7 @@
 			my_used_size + my_unchecked_size + my_dirty_size,
 			c->sector_size);
 		jffs3_dbg_dump_node_refs(c, jeb);
+		jffs3_dbg_dump_block_lists(c);
 		BUG();
 	}
 }

Index: debug.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/debug.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- debug.h	25 Dec 2004 11:11:21 -0000	1.19
+++ debug.h	3 Jan 2005 18:40:11 -0000	1.20
@@ -95,7 +95,7 @@
 #define JFFS3_DBG_SUBSYS_VFS_PRINT	1
 #define JFFS3_DBG_SUBSYS_BLD_PRINT	1
 #define JFFS3_DBG_SUBSYS_COMPR_PRINT	1
-#define JFFS3_DBG_SUBSYS_SUMMARY_PRINT  1
+#define JFFS3_DBG_SUBSYS_SUMMARY_PRINT	1
 #define JFFS3_DBG_SUBSYS_RI_PRINT	1
 #define JFFS3_DBG_SUBSYS_BI_PRINT	1
 #define JFFS3_DBG_SUBSYS_RSV_PRINT	1
@@ -114,7 +114,7 @@
 #define JFFS3_DBG_SUBSYS_VFS_PRINT	0
 #define JFFS3_DBG_SUBSYS_BLD_PRINT	0
 #define JFFS3_DBG_SUBSYS_COMPR_PRINT	0
-#define JFFS3_DBG_SUBSYS_SUMMARY_PRINT  0
+#define JFFS3_DBG_SUBSYS_SUMMARY_PRINT	0
 #define JFFS3_DBG_SUBSYS_RI_PRINT	0
 #define JFFS3_DBG_SUBSYS_BI_PRINT	0
 #define JFFS3_DBG_SUBSYS_RSV_PRINT	0
@@ -384,7 +384,7 @@
 	 * During mounting c->nextblock may be uninitialized, so don't
 	 * check it if JFFS3_SB_FLAG_MOUNTING flag is set.
 	 */
-	if ((!(c->flags & JFFS3_SB_FLAG_MOUNTING) && jeb != c->nextblock)
+	if (jeb != c->nextblock
 		|| ref_offset(ref) != jeb->offset + (c->sector_size - jeb->free_size)) {
 		WARNING_MSG("Argh. Node added in wrong place.\n");
 		printk(KERN_ERR "c->nextblock %p, jeb %p, new offs %#08x, new len %#x, "

Index: dir.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/dir.c,v
retrieving revision 3.6
retrieving revision 3.7
diff -u -r3.6 -r3.7
--- dir.c	25 Dec 2004 11:11:21 -0000	3.6
+++ dir.c	3 Jan 2005 18:40:11 -0000	3.7
@@ -189,6 +189,7 @@
 	struct inode *inode;
 	int ret;
 
+	DBG_VFS(1, "entering\n");
 	ri = jffs3_alloc_raw_inode();
 	if (!ri)
 		return -ENOMEM;
@@ -244,6 +245,7 @@
 	struct jffs3_inode_info *dead_f = JFFS3_INODE_INFO(dentry->d_inode);
 	int ret;
 
+	DBG_VFS(1, "entering\n");
 	ret = jffs3_do_unlink(c, dir_f, dentry->d_name.name,
 			       dentry->d_name.len, dead_f);
 	if (dead_f->inocache)
@@ -261,6 +263,7 @@
 	int ret;
 	uint8_t type;
 
+	DBG_VFS(1, "entering\n");
 	/* Don't let people make hard links to bad inodes. */
 	if (!f->inocache)
 		return -EIO;
@@ -299,6 +302,7 @@
 	uint32_t alloclen, phys_ofs;
 	int ret;
 
+	DBG_VFS(1, "entering\n");
 	/* FIXME: If you care. We'd need to use frags for the target
 	   if it grows much more than this */
 	if (strlen(target) > 254)
@@ -436,6 +440,7 @@
 
 	mode |= S_IFDIR;
 
+	DBG_VFS(1, "entering\n");
 	ri = jffs3_alloc_raw_inode();
 	if (!ri)
 		return -ENOMEM;
@@ -555,6 +560,7 @@
 	struct jffs3_full_dirent *fd;
 	int ret;
 
+	DBG_VFS(1, "entering\n");
 	for (fd = f->dents ; fd; fd = fd->next) {
 		if (fd->ino)
 			return -ENOTEMPTY;
@@ -580,6 +586,7 @@
 	uint32_t alloclen, phys_ofs;
 	int ret;
 
+	DBG_VFS(1, "entering\n");
 	if (!old_valid_dev(rdev))
 		return -EINVAL;
 
@@ -719,6 +726,7 @@
 	 * the VFS can't check whether the victim is empty. The filesystem
 	 * needs to do that for itself.
 	 */
+	DBG_VFS(1, "entering\n");
 	if (new_dentry->d_inode) {
 		victim_f = JFFS3_INODE_INFO(new_dentry->d_inode);
 		if (S_ISDIR(new_dentry->d_inode->i_mode)) {





More information about the linux-mtd-cvs mailing list