UBIFS: How to reserve space to be used right before power cut

Matthieu CASTET matthieu.castet at parrot.com
Thu Jun 13 07:50:31 EDT 2013


Hi,

Why do you do this in ubifs ?

If you do it in ubi/mtd this will be a lot's of easier.



Matthieu


Le Thu, 13 Jun 2013 12:42:18 +0100,
Helmut Raiger <helmut.raiger at hale.at> a écrit :

> Hi,
> 
>      we try the following:
> 
> 1) setup some data in an 8kByte block in RAM
> 2) frequently modify this data during normal operation
> 3) on a power fail signal write the block to a file on an UBIFS
> partition 4) recover from the written data after the power cut
> 
>    The time between power failure notification and the uP-reset is 
> guaranteed by hardware
> and is about 20ms.
> 
> We first thought about using fallocate() to allocate a corresponding 
> block on the partition
> but soon found that UBIFS does not implement a native fallocate() and 
> thus the generic
> one simply wrote the file to 8k of zeros. This of course will not
> help.
> 
> Simply fsync()ing the file in case of a power cut does not seem 
> reliable, for
>    - the file system might be full
>    - write back cache operation may interfere with the synch-ing of
> our file
>    - the garbage collector might run to free dirty LEBs and erase the 
> corresponding PEBs
> The latter 2 overstretching our timing requirements.
> 
> This is on an embedded system (i.mx31, arm1136 at 532MHz) running Linux 
> 3.something
> (we are quite flexible in adapting new kernel versions), currently 
> testing on 3.0.45.
> 
> Could someone hint the course to follow for this szenario?
> 
> Any pointers appreciated,
> Helmut
> 
> 
> --
> Scanned by MailScanner.
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/




More information about the linux-mtd mailing list