Google's new Nexus S smartphone is the first Android device to use the Ext4 filesystem. The company published a statement on the official Android developer blog earlier this month to discuss how adoption of Ext4 on Android will impact third-party application developers.
In a follow-up post last week, Ext4 developer Ted T'so commented on the transition and offered some further clarification regarding concerns about fsync data loss issues, which he says pose minimal risk on Android due to the higher level of quality assurance testing.
An expert on filesystem development, T'so played a key role in developing Ext4, the current generation of the Linux kernel's standard filesystem. He was hired earlier this year by Google when the search giant was transitioning its server storage infrastructure from Ext2 to Ext4. He says that he didn't influence the decision to use Ext4 in Android, but provided some advice and guidance to the Android team after the decision was made.
Most Android devices currently use YAFFS, a lightweight filesystem that is optimized for flash storage and is commonly used in mobile and embedded devices. The problem with YAFFS, T'so explained in his blog entry, is that it is single-threaded and would likely "have been a bottleneck on dual-core systems." Concurrency will be important on next-generation Android devices that use multi-core ARM processors. We expect to see dual-core Android devices, including tablets, announced as early as CES.
As Tim Bray explained on the Android developer blog, applications that use the platform's high-level storage abstractions will generally not have to worry about the transition. Developers who are accessing the filesystem directly will have to be mindful about Ext4's buffering behavior and make sure that the data is actually reaching persistent storage in a timely manner so that it won't be lost in the event of a system failure.
T'so says that there isn't much need for concern. Google and the handset makers will catch platform-level filesystem reliability issues, ensuring that the high-level storage APIs are safe. He also believes that the significant amount of product QA conducted by the vendors will reduce the risk of random crashes. Short of users yanking out the battery, he says, it's unlikely that Android devices will routinely run into the kind of system failure that causes data loss for applications that don't properly use fsync.
T'so also addressed the question of why Google would pass on Oracle's Btrfs, which is expected to eventually displace Ext4 in the future. Btrfs simply isn't mature enough yet for use in production. Canonical considered using Btrfs as the default filesystem in Ubuntu 10.10, but postponed adoption after similarly deciding that it needed more time in the oven. Nokia and Intel have adopted Btrfs for MeeGo, though it's unclear if they will stick with that decision when MeeGo ships on actual consumer devices. It's clear that Ext4 still has an important role to play while the issues in Btrfs are being ironed out.
Source: ars technica