From: Jan Altenberg <jan.altenberg@linutronix.de>
To: linux-mtd@lists.infradead.org
Cc: Artem.Bityutskiy@nokia.com, tglx@linutronix.de
Subject: [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes
Date: Fri, 28 Mar 2008 16:13:53 +0100 [thread overview]
Message-ID: <1206717233.5461.31.camel@jan-laptop> (raw)
Hi all,
I came across a problem which seems to be present since:
commit 941dfb07ed91451b1c58626a0d258dfdf468b593
UBI: set correct gluebi device size
ubi_create_gluebi() leaves mtd->size = 0 for static volumes. So even
existing static volumes are initialized with a size of 0.
See attached patch (applies on top of latest git).
Signed-off-by: Jan Altenberg <jan.altenberg@linutronix.de>
---
drivers/mtd/ubi/gluebi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/mtd/ubi/gluebi.c
===================================================================
--- linux-2.6.orig/drivers/mtd/ubi/gluebi.c
+++ linux-2.6/drivers/mtd/ubi/gluebi.c
@@ -291,11 +291,12 @@ int ubi_create_gluebi(struct ubi_device
/*
* In case of dynamic volume, MTD device size is just volume size. In
* case of a static volume the size is equivalent to the amount of data
- * bytes, which is zero at this moment and will be changed after volume
- * update.
+ * bytes.
*/
if (vol->vol_type == UBI_DYNAMIC_VOLUME)
mtd->size = vol->usable_leb_size * vol->reserved_pebs;
+ else
+ mtd->size = vol->used_bytes;
if (add_mtd_device(mtd)) {
ubi_err("cannot not add MTD device\n");
next reply other threads:[~2008-03-28 15:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 15:13 Jan Altenberg [this message]
2008-03-28 15:29 ` [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1206717233.5461.31.camel@jan-laptop \
--to=jan.altenberg@linutronix.de \
--cc=Artem.Bityutskiy@nokia.com \
--cc=linux-mtd@lists.infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).