Patchwork mkfs.jffs2: fix repeated dev nodes

login
register
mail settings
Submitter Thomas Chou
Date Dec. 31, 2010, 1:45 a.m.
Message ID <1293759919-3297-1-git-send-email-thomas@wytron.com.tw>
Download mbox | patch
Permalink /patch/77044/
State New
Headers show

Comments

Thomas Chou - Dec. 31, 2010, 1:45 a.m.
Fix the repeated nodes with the same primary name in device_table.txt.
They were not generated correctly.

/dev/tty    c    666    0    0    5    0    0    0    -
/dev/tty    c    666    0    0    4    0    0    1    6

# IDE Devices
/dev/hda    b    640    0    0    3    0    0    0    -
/dev/hda    b    640    0    0    3    1    1    1    15
/dev/hdb    b    640    0    0    3    64    0    0    -
/dev/hdb    b    640    0    0    3    65    1    1    15

Only created,
/dev/tty
/dev/hda
/dev/hdb

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---
 mkfs.jffs2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Jan. 16, 2011, 6:51 p.m.
On Fri, 2010-12-31 at 09:45 +0800, Thomas Chou wrote:
> Fix the repeated nodes with the same primary name in device_table.txt.
> They were not generated correctly.
> 
> /dev/tty    c    666    0    0    5    0    0    0    -
> /dev/tty    c    666    0    0    4    0    0    1    6
> 
> # IDE Devices
> /dev/hda    b    640    0    0    3    0    0    0    -
> /dev/hda    b    640    0    0    3    1    1    1    15
> /dev/hdb    b    640    0    0    3    64    0    0    -
> /dev/hdb    b    640    0    0    3    65    1    1    15
> 
> Only created,
> /dev/tty
> /dev/hda
> /dev/hdb
> 
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

Pushed, thanks.

Patch

diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
index 256eec4..717e1cc 100644
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -457,7 +457,7 @@  static int interpret_table_entry(struct filesystem_entry *root, char *line)
 			errmsg_die("Unsupported file type '%c'", type);
 	}
 	entry = find_filesystem_entry(root, name, mode);
-	if (entry) {
+	if (entry && !(count > 0 && (type == 'c' || type == 'b'))) {
 		/* Ok, we just need to fixup the existing entry
 		 * and we will be all done... */
 		entry->sb.st_uid = uid;