Zack's Kernel News
Zack's Kernel News

Chronicler Zack Brown reports on the latest news, views, dilemmas, and developments within the Linux kernel community.
Protecting Filesystems from Themselves
Chao Yu recently tried to revert a kernel commit for an F2FS patch. F2FS is a Samsung filesystem for solid state drives. Chao wanted to revert the patch because one of the kernel's generic tests expected F2FS to fail to mount a read-only partition. Ironically, as pointed out by Jaegeuk Kim, F2FS had no trouble mounting such a partition and giving the user full read access to all its data. So the filesystem failed the test … because it succeeded.
Jaegeuk suggested changing the test rather than reverting the patch, but Chao pointed out that the test was actually important for filesystems in general, not just F2FS. Changing the test for that one case, he said, would mean other filesystems might technically pass the test when they really should fail.
Chao also disagreed with Jaegeuk that F2FS handled the case properly. Walking through the code, he identified a certain point at which, he said, the device was then read-only, so that all writes would fail. Therefore, recovered data would not be able to persist beyond the expiration of the page cache. At that point, he said, the user would see stale data instead of the latest system state.
[...]
Buy this article as PDF
(incl. VAT)