bug in UBI

Vinit Agnihotri vinit.agnihotri at gmail.com
Wed Jul 4 06:20:20 EDT 2007


When attaching a UBI to a mtd device, UBI reports following mesage
UBI: attached mtd0 to ubi1


I use AMD 64Bit dual core processor with 2.6.18.3 kernel.
heres my /proc/mtd output
[root at localhost ~]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 0000000008000000 0000000000400000 "mtd0"

After insertion of UBI module, UBI displays message
UBI: attached mtd0 to ubi1

However UBI creates device entry as /dev/ubi0, so message is incorrect.
I looked into code & it requires some code lines to be ordered properly.

heres the patch:

signedoff by Vinit Agnihotri
--- build.c.orig	2007-07-04 15:49:44.000000000 +0530
+++ build.c	2007-07-04 15:50:32.000000000 +0530
@@ -593,7 +593,6 @@
 	if (err)
 		goto out_detach;

-	ubi_devices_cnt += 1;

 	ubi_msg("attached mtd%d to ubi%d", ubi->mtd->index, ubi_devices_cnt);
 	ubi_msg("MTD device name:            \"%s\"", ubi->mtd->name);
@@ -624,6 +623,7 @@
 		wake_up_process(ubi->bgt_thread);
 	}

+	ubi_devices_cnt += 1;
 	return 0;

 out_detach:



More information about the linux-mtd mailing list