mtd/fs/jffs2 fs.c,1.38,1.39

gleixner at infradead.org gleixner at infradead.org
Wed Apr 14 08:57:57 EDT 2004


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

Modified Files:
	fs.c 
Log Message:
Check flashsize vs. erasesize

Index: fs.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/fs.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- fs.c	8 Mar 2004 15:29:09 -0000	1.38
+++ fs.c	14 Apr 2004 12:57:54 -0000	1.39
@@ -454,6 +454,14 @@
 		blocks >>= 1;
 	
 	c->sector_size = c->flash_size / blocks;
+	/*
+	 * Size alignment check
+	 */
+	if ((c->sector_size * blocks) != c->flash_size) {
+		printk(KERN_ERR "jffs2: Flash size not aligned to erasesize\n");
+		return -EINVAL;
+	}
+
 	if (c->sector_size != c->mtd->erasesize)
 		printk(KERN_INFO "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
 			c->mtd->erasesize / 1024, c->sector_size / 1024);




More information about the linux-mtd-cvs mailing list