mtd/fs/jffs2 scan.c,1.51.2.2,1.51.2.3

David Woodhouse dwmw2 at infradead.org
Thu Jul 25 16:49:08 EDT 2002


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

Modified Files:
      Tag: jffs2-2_4-branch
	scan.c 
Log Message:
Check for nodes going over end-of-block.


Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.51.2.2
retrieving revision 1.51.2.3
diff -u -r1.51.2.2 -r1.51.2.3
--- scan.c	23 Feb 2002 13:34:31 -0000	1.51.2.2
+++ scan.c	25 Jul 2002 20:49:06 -0000	1.51.2.3
@@ -261,6 +261,16 @@
 			continue;
 		}
 
+		if (ofs + node.totlen > jeb->offset + c->sector_size) {
+			/* Eep. Node goes over the end of the erase block. */
+			printk(KERN_WARNING "Node at 0x%08x with length 0x%08x would run over the end of the erase block\n",
+			       ofs, node.totlen);
+			printk(KERN_WARNING "Perhaps the file system was created with the wrong erase size?\n");
+			DIRTY_SPACE(4);
+			ofs += 4;
+			continue;
+		}
+
 		switch(node.nodetype | JFFS2_NODE_ACCURATE) {
 		case JFFS2_NODETYPE_INODE:
 			err = jffs2_scan_inode_node(c, jeb, &ofs);





More information about the linux-mtd-cvs mailing list