[PATCH] mkfs.jffs2: fix devtable count as mkfs.ubifs does

Thomas Chou thomas at wytron.com.tw
Thu Dec 30 22:16:06 EST 2010


The counting was incorrect. Follow that of mkfs.ubifs.

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
 mkfs.jffs2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
index 717e1cc..3aab533 100644
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -497,10 +497,10 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line)
 					unsigned long i;
 					char *dname, *hpath;
 
-					for (i = start; i < count; i++) {
+					for (i = start; i < (start + count); i++) {
 						xasprintf(&dname, "%s%lu", name, i);
 						xasprintf(&hpath, "%s/%s%lu", rootdir, name, i);
-						rdev = makedev(major, minor + (i * increment - start));
+						rdev = makedev(major, minor + (i - start) * increment);
 						add_host_filesystem_entry(dname, hpath, uid, gid,
 								mode, rdev, parent);
 						free(dname);
-- 
1.7.3.4




More information about the linux-mtd mailing list