ubifs robustness with early power cut warning

Doug Crawford dcraw101 at gmail.com
Fri Sep 29 16:20:00 PDT 2017


We have an embedded system with an early power loss warning.  The
power supply drives a powerdown signal connected to a GPIO pin on the
CPU.  When AC power is switched off the power supply drives this
signal low for 500 milliseconds before the CPU gets held in reset.  If
AC power is switched back on before 500 milliseconds the powerdown
signal goes high again and the system is expected to continue running
normally.

I am wondering if there is a way to easily modify ubifs/ubi such that
when the powerdown gpio is low VFS or UBIFS or UBI freezes or pauses
further writes to the NAND.  If powerdown recovers to high again then
the filesystem would unfreeze and allow further writes?  Has anyone
implemented something like this before?  I know UBIFS/UBI is designed
to be very resilient to power cuts, but I am thinking this technique
might make the system even more resilient.  If I were to make this
change which file would be the right one to hook into:
fs/ubifs/super.c?



More information about the linux-mtd mailing list