UBI: Cannot create static volumes when FTL is enabled

Artem Bityutskiy dedekind at infradead.org
Sat May 5 09:40:30 EDT 2007


On Sat, 2007-05-05 at 14:54 +0300, Artem Bityutskiy wrote:
> On Sat, 2007-05-05 at 14:39 +0300, Artem Bityutskiy wrote:
> > So you see that dynamic volumes are mapped to the MTD device model quite
> > nicely: mtd device size = volume size.
> > 
> > Size of static volumes depends on how much data you put there. And since
> > MTD infrastructure assumes that MTD device sizes are stable, there is no
> > good and nice way to emulate MTD devices on top of static volumes,
> > unless MTD subsystem is somehow re-designed.
> > 
> > But anyway, you have found a bug. I am going to disable MTD device
> > emulation for static volumes.
> 
> Although it still would be nice to have MTD device emulation for static
> volumes. May be we have the same semantics as dynamic volumes if they
> are used via gluebi. It needs more thinking.

Well, after thinking more I have fixed this. Now we set emulated mtd
device size to data size if the volume is static.

I.e., when you create a static volume, its size is zero:

# ubimkvol -d0 -n0 -Nvol1 -s60MiB -t static
# cat /sys/class/ubi/ubi0_0/data_bytes
# 0

# cat /proc/mtd
# dev:    size   erasesize  name
# mtd0: 08000000 00004000 "NAND simulator partition 0"
# mtd1: 00000000 00003e00 "vol1"

# ubiupdatevol -d 0 -n 0 small_file_72_bytes
# cat /sys/class/ubi/ubi0_0/data_bytes
# 72

# cat /proc/mtd
# dev:    size   erasesize  name
# mtd0: 08000000 00004000 "NAND simulator partition 0"
# mtd1: 00000048 00003e00 "vol1"

I've committed the fix to git://git.infradead.org/~dedekind/ubi-2.6.git.
Or see
http://git.infradead.org/?p=users/dedekind/ubi-2.6.git;a=commit;h=962f24709f91fe0634b3faa3cac915c66357a239

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





More information about the linux-mtd mailing list