Skip to contentSkip to conversation

UBI: fix bug in image sequence number handling

PATCH In review Holger Brunck 2 participants 2 messages Jul 13, 2009 – Jul 14, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: fix bug in image sequence number handling

Hi all,
I have seen a bug on the current 2.6.28 backport for UBI. But the same bug seems to be present in the current ubi-2.6.git.

This patch fixes a bug in the image seq. number handling in the scanning level. The assignment of the image_seq was incorrect.

---
 drivers/mtd/ubi/scan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/ubi/scan.c +0 -0
index 065c4ba..e337b0b 100644
@@ -781,7 +781,7 @@ static int process_eb(struct ubi_device *ubi, struct

ubi_scan_info *si,
return -EINVAL;
}

- image_seq = be32_to_cpu(ech->ec);
+ image_seq = be32_to_cpu(ech->image_seq);
if (!si->image_seq_set) {
ubi->image_seq = image_seq; si->image_seq_set = 1;

Signature · 4 lines
1.6.0.1

Regards
Holger Brunck
#1 lore raw
Quoted 26 lines · Holger Brunck

Hi all,
I have seen a bug on the current 2.6.28 backport for UBI. But the same bug seems to be present in the current ubi-2.6.git.

This patch fixes a bug in the image seq. number handling in the scanning level. The assignment of the image_seq was incorrect.

---
 drivers/mtd/ubi/scan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/ubi/scan.c +1 -1
index 065c4ba..e337b0b 100644
@@ -781,7 +781,7 @@ static int process_eb(struct ubi_device *ubi, struct
 ubi_scan_info *si,
 			return -EINVAL;
 		}
 
-		image_seq = be32_to_cpu(ech->ec);
+		image_seq = be32_to_cpu(ech->image_seq);
 		if (!si->image_seq_set) {
 			ubi->image_seq = image_seq;
Quoted 1 line

si->image_seq_set = 1;

Yes, this is me who did this in the
"UBI: nicify image sequence number handling" commit. Sorry, really shame bug. Where is my brown paper-bag? I've pushed your patch to all trees.

BTW, the patch was line-wrapped.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)