mtd/fs/jffs2 scan.c,1.78,1.79

David Woodhouse dwmw2 at infradead.org
Thu Jul 25 16:48:53 EDT 2002


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

Modified Files:
	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.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- scan.c	2 Jul 2002 22:48:24 -0000	1.78
+++ scan.c	25 Jul 2002 20:48:51 -0000	1.79
@@ -322,6 +322,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;
+		}
+
 		if (!(node.nodetype & JFFS2_NODE_ACCURATE)) {
 			/* Wheee. This is an obsoleted node */
 			D2(printk(KERN_DEBUG "Node at 0x%08x is obsolete. Skipping\n", ofs));





More information about the linux-mtd-cvs mailing list