public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes
@ 2008-03-28 15:13 Jan Altenberg
  2008-03-28 15:29 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Altenberg @ 2008-03-28 15:13 UTC (permalink / raw)
  To: linux-mtd; +Cc: Artem.Bityutskiy, tglx

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");

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes
  2008-03-28 15:13 [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes Jan Altenberg
@ 2008-03-28 15:29 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2008-03-28 15:29 UTC (permalink / raw)
  To: Jan Altenberg; +Cc: tglx, linux-mtd


On Fri, 2008-03-28 at 16:13 +0100, Jan Altenberg wrote:
> 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).

Fair enough, applied, thank you!

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-28 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 15:13 [PATCH] ubi_create_gluebi: Initialize static volumes with vol->used_bytes Jan Altenberg
2008-03-28 15:29 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox