From patchwork Fri Dec 31 03:16:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 77045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from canuck.infradead.org (canuck.infradead.org [134.117.69.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D2ACB70AF for ; Fri, 31 Dec 2010 14:17:49 +1100 (EST) Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PYVSA-0008Tl-33; Fri, 31 Dec 2010 03:14:54 +0000 Received: from www.wytron.com.tw ([211.75.82.101]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PYVS6-0008TU-MO for linux-mtd@lists.infradead.org; Fri, 31 Dec 2010 03:14:51 +0000 Received: from [192.168.1.15] (helo=darkstar.wytron.com.tw) by www.wytron.com.tw with esmtp (Exim 4.69) (envelope-from ) id 1PYVRz-0001GS-BN; Fri, 31 Dec 2010 11:14:43 +0800 From: Thomas Chou To: Artem Bityutskiy Subject: [PATCH] mkfs.jffs2: fix devtable count as mkfs.ubifs does Date: Fri, 31 Dec 2010 11:16:06 +0800 Message-Id: <1293765366-27147-1-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <4D1C3565.1030800@wytron.com.tw> References: <4D1C3565.1030800@wytron.com.tw> X-SA-Exim-Connect-IP: 192.168.1.15 X-SA-Exim-Mail-From: thomas@wytron.com.tw X-SA-Exim-Scanned: No (on www.wytron.com.tw); SAEximRunCond expanded to false X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20101230_221451_054499_27A133F1 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: linux-mtd@lists.infradead.org, Mike Frysinger , Thomas Chou X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The counting was incorrect. Follow that of mkfs.ubifs. Signed-off-by: Thomas Chou --- mkfs.jffs2.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c index 717e1cc..3aab533 100644 --- a/mkfs.jffs2.c +++ b/mkfs.jffs2.c @@ -497,10 +497,10 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line) unsigned long i; char *dname, *hpath; - for (i = start; i < count; i++) { + for (i = start; i < (start + count); i++) { xasprintf(&dname, "%s%lu", name, i); xasprintf(&hpath, "%s/%s%lu", rootdir, name, i); - rdev = makedev(major, minor + (i * increment - start)); + rdev = makedev(major, minor + (i - start) * increment); add_host_filesystem_entry(dname, hpath, uid, gid, mode, rdev, parent); free(dname);