[PATCH] [MTD] UBI: fix peb scan

Alexander Schmidt alexs at linux.vnet.ibm.com
Fri Mar 2 05:29:30 EST 2007


Hi Artem,

Volumes containing only one PEB got a wrong vtr->last_eb_bytes.

Signed-off-by: Alexander Schmidt <alexs at linux.vnet.ibm.com>
---
 drivers/mtd/ubi/scan.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- dedekind-ubi-2.6.orig/drivers/mtd/ubi/scan.c
+++ dedekind-ubi-2.6/drivers/mtd/ubi/scan.c
@@ -588,7 +588,7 @@ int ubi_scan_add_peb(const struct ubi_in
 	seb->scrub = bitflips;
 	seb->leb_ver = leb_ver;
 
-	if (sv->highest_lnum < lnum) {
+	if (sv->highest_lnum <= lnum) {
 		sv->highest_lnum = lnum;
 		sv->last_data_size = ubi32_to_cpu(vid_hdr->data_size);
 	}




More information about the linux-mtd mailing list