[PATCH] [UBI] Resize of static volumes

Alexander Schmidt alexs at linux.vnet.ibm.com
Fri Dec 15 08:03:42 EST 2006


Hi,

I noticed that after resizing static volumes, the used_bytes value in the
data table record is set to the new size of the volume. This is correct
for dynamic volumes, but for static volumes, this value should not be
changed.

Kind regards,

Alexander Schmidt

Signed-off-by: Alexander Schmidt, <alexs at linux.vnet.ibm.com>

---

diff --git a/drivers/mtd/ubi/volmgmt.c b/drivers/mtd/ubi/volmgmt.c
index 750dfa1..cb9fbad 100644
--- a/drivers/mtd/ubi/volmgmt.c
+++ b/drivers/mtd/ubi/volmgmt.c
@@ -241,7 +241,7 @@ int ubi_vmt_rsvol(const struct ubi_info *ubi, int vol_id, int reserved_pebs)
         if (err)
                 goto out_unlock;

-       ubi_dtbl_set_dtr(ubi, vol_id, reserved_pebs * vtr->usable_leb_size);
+       ubi_dtbl_set_dtr(ubi, vol_id, dtr->used_bytes);

         err = ubi_wl_erase_flush(ubi);





More information about the linux-mtd mailing list