Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=76eafe479ec30dd72b8cf209c4f576eac3c93112 Commit: 76eafe479ec30dd72b8cf209c4f576eac3c93112 Parent: 2f176f79877937082ce052977e552a75e23a73d1 Author: Brijesh Singh <[EMAIL PROTECTED]> AuthorDate: Fri Jul 6 14:35:43 2007 +0300 Committer: Artem Bityutskiy <[EMAIL PROTECTED]> CommitDate: Wed Jul 18 16:57:52 2007 +0300
UBI: bugfix in sqnum calculation 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 <[EMAIL PROTECTED]> Signed-off-by: Artem Bityutskiy <[EMAIL PROTECTED]> --- drivers/mtd/ubi/scan.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 23e30ac..ce26b1b 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -437,6 +437,9 @@ int ubi_scan_add_used(const struct ubi_device *ubi, struct ubi_scan_info *si, if (IS_ERR(sv) < 0) return PTR_ERR(sv); + if (si->max_sqnum < sqnum) + si->max_sqnum = sqnum; + /* * Walk the RB-tree of logical eraseblocks of volume @vol_id to look * if this is the first instance of this logical eraseblock or not. @@ -563,9 +566,6 @@ int ubi_scan_add_used(const struct ubi_device *ubi, struct ubi_scan_info *si, sv->last_data_size = be32_to_cpu(vid_hdr->data_size); } - if (si->max_sqnum < sqnum) - si->max_sqnum = sqnum; - sv->leb_count += 1; rb_link_node(&seb->u.rb, parent, p); rb_insert_color(&seb->u.rb, &sv->root); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html