UBIFS file system is hardened against power loss scenarios

UBIFS file system is hardened against power loss scenarios

LINUX STORAGE

While most Linux filesystems are fairly robust in recovering when the system experiences a power loss, the UBIFS filesystem is more susceptible to problems when a power loss occurs. With patches submitted for the Linux 6.11 merge window, UBIFS is being hardened somewhat to better handle the loss of power.

The Unsorted Block Image File System (UBIFS) for flash memory devices can develop problems and have an inconsistent file system state if the power goes out unexpectedly. Fortunately, most UBIFS used in smartphones or other devices are battery powered and can be safely powered off before the battery runs out, but with Linux 6.11 there are some hardening improvements for UBIFS to deal with this situation.

Nokia N900, Nokia originally developed UBIFS

A set of nine patches are part of the UBIFS pull request for Linux 6.11 to address several inconsistent issues that can occur during a power loss. These fixes and hardening make the flash file system more robust, but come at a small performance cost. Sequential writes in tests by developer Zhihao Cheng resulted in a drop from 412 MB/s to 409 MB/s, the FS-Mark benchmark dropped from 7131 files/s to 7090 files/s, and other minor performance losses were noted as a result of these patches. Still, a small performance cost is better than potential data loss in the event of unexpected power loss.

This improved UBIFS handling of power failure situations was submitted as part of the UBIFS pull request for the Linux 6.11 merge period ending this weekend.