UBI Patch: Max Sequence no not updated in scan.c

brijesh.singh at calsoftinc.com brijesh.singh at calsoftinc.com
Fri Jul 6 05:00:08 EDT 2007


Hi,I came across problem of having two leb with same sequence no.This
happens when we continuously write one block again and again and reboot
machine before background thread erases those blocks.
The problem here was,when we find two blocks with same sequence no,we take
the higher one,but we were not updating max seq no,so next block may have
the same seqnum.
This patch solves this problem.


Signed-off-by: Brijesh Singh <brijesh.s.singh at gmail.com>

Index: mtd-2.6/drivers/mtd/ubi/scan.c
===================================================================
--- mtd-2.6.orig/drivers/mtd/ubi/scan.c	2007-07-04 16:58:43.000000000 +0530
+++ mtd-2.6/drivers/mtd/ubi/scan.c	2007-07-06 13:57:53.000000000 +0530
@@ -510,6 +510,9 @@
 				sv->last_data_size =
 					ubi32_to_cpu(vid_hdr->data_size);

+			if (si->max_sqnum < sqnum)
+				si->max_sqnum = sqnum;
+
 			return 0;
 		} else {
 			/*





More information about the linux-mtd mailing list