From patchwork Mon Jul 13 14:47:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Brunck X-Patchwork-Id: 29736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id C4262B707B for ; Tue, 14 Jul 2009 00:50:43 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MQMp8-0002ZQ-R3; Mon, 13 Jul 2009 14:48:10 +0000 Received: from mail.de.keymile.com ([195.8.104.1]) by bombadil.infradead.org with smtp (Exim 4.69 #1 (Red Hat Linux)) id 1MQMoy-0002Wx-Dp for linux-mtd@lists.infradead.org; Mon, 13 Jul 2009 14:48:07 +0000 Received: from mailrelay.de.keymile.net ([10.9.1.54]) by eSafe SMTP Relay 1245178923; Mon, 13 Jul 2009 16:41:32 +0200 Received: from srvdehan1003.de.keymile.net (srvdehan1003.de.keymile.net [10.9.1.108]) by mailrelay.de.keymile.net (8.12.2/8.12.2) with ESMTP id n6DEihjp002145 for ; Mon, 13 Jul 2009 16:44:43 +0200 (MEST) Received: from 172.30.2.67 ([172.30.2.67]) by srvdehan1003.de.keymile.net ([10.9.1.108]) with Microsoft Exchange Server HTTP-DAV ; Mon, 13 Jul 2009 14:47:57 +0000 Received: from pc005093.de.keymile.net by srvdehan1003.de.keymile.net; 13 Jul 2009 16:47:57 +0200 Subject: [PATCH] UBI: fix bug in image sequence number handling From: Holger Brunck To: linux-mtd@lists.infradead.org Date: Mon, 13 Jul 2009 16:47:57 +0200 Message-Id: <1247496477.3590.40.camel@pc005093.de.keymile.net> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.3) X-ESAFE-STATUS: Mail allowed X-ESAFE-DETAILS: X-Spam-Score: 0.0 (/) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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. Signed-off-by: Holger Brunck --- drivers/mtd/ubi/scan.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) si->image_seq_set = 1; diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 065c4ba..e337b0b 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -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;