UBIFS: How to reserve space to be used right before power cut
Helmut Raiger
helmut.raiger at hale.at
Thu Jun 13 07:42:18 EDT 2013
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.
More information about the linux-mtd
mailing list