mtd/fs/jffs2 nodelist.c,1.118,1.119 scan.c,1.133,1.134

havasi at infradead.org havasi at infradead.org
Fri Jan 13 05:25:32 EST 2006


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

Modified Files:
	nodelist.c scan.c 
Log Message:
[JFFS2] Fix EBH problems and check_node_data() warnings

In scan.c:
- fix buf_ofs => ofs at calling jffs2_flash_read_safe() [EBH]
In nodelist.c:
- avoid dummy warnings in check_node_data()

This patch was written by Alexey Korolev and Zoltan Sogor.



Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- nodelist.c	13 Nov 2005 18:22:07 -0000	1.118
+++ nodelist.c	13 Jan 2006 10:25:28 -0000	1.119
@@ -436,7 +436,7 @@
 	 * adding and jffs2_flash_read_end() interface. */
 	if (c->mtd->point) {
 		err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);
-		if (!err && retlen < tn->csize) {
+		if (!err && retlen < len) {
 			JFFS2_WARNING("MTD point returned len too short: %u instead of %u.\n", retlen, tn->csize);
 			c->mtd->unpoint(c->mtd, buffer, ofs, len);
 		} else if (err)

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- scan.c	18 Nov 2005 07:27:45 -0000	1.133
+++ scan.c	13 Jan 2006 10:25:29 -0000	1.134
@@ -454,7 +454,7 @@
 			buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
 			D1(printk(KERN_DEBUG "Fewer than %zd bytes (node header) left to end of buf. Reading 0x%x at 0x%08x\n",
 				  sizeof(struct jffs2_unknown_node), buf_len, ofs));
-			err = jffs2_flash_read_safe(c, buf_ofs, buf_len, buf);
+			err = jffs2_flash_read_safe(c, ofs, buf_len, buf);
 			if (err)
 				return err;
 			buf_ofs = ofs;
@@ -511,7 +511,7 @@
 				break;
 			}
 			D1(printk(KERN_DEBUG "Reading another 0x%x at 0x%08x\n", buf_len, ofs));
-			err = jffs2_flash_read_safe(c, buf_ofs, buf_len, buf);
+			err = jffs2_flash_read_safe(c, ofs, buf_len, buf);
 			if (err)
 				return err;
 			buf_ofs = ofs;
@@ -587,7 +587,7 @@
 				buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
 				D1(printk(KERN_DEBUG "Fewer than %zd bytes (inode node) left to end of buf. Reading 0x%x at 0x%08x\n",
 					  sizeof(struct jffs2_raw_inode), buf_len, ofs));
-				err = jffs2_flash_read_safe(c, buf_ofs, buf_len, buf);
+				err = jffs2_flash_read_safe(c, ofs, buf_len, buf);
 				if (err)
 					return err;
 				buf_ofs = ofs;
@@ -603,7 +603,7 @@
 				buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
 				D1(printk(KERN_DEBUG "Fewer than %d bytes (dirent node) left to end of buf. Reading 0x%x at 0x%08x\n",
 					  je32_to_cpu(node->totlen), buf_len, ofs));
-				err = jffs2_flash_read_safe(c, buf_ofs, buf_len, buf);
+				err = jffs2_flash_read_safe(c, ofs, buf_len, buf);
 				if (err)
 					return err;
 				buf_ofs = ofs;
@@ -650,7 +650,7 @@
 			} else {
 				if (buf_ofs + buf_len < ofs + je32_to_cpu(node->totlen)) {
 					buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
-					err = jffs2_flash_read_safe(c, buf_ofs, buf_len, buf);
+					err = jffs2_flash_read_safe(c, ofs, buf_len, buf);
 					if (err)
 						return err;
 					buf_ofs = ofs;





More information about the linux-mtd-cvs mailing list