fs/ext2: support legacy Rev0 superblocks #421
Reference in New Issue
Block a user
Delete Branch "Matou1306/kolibrios:ext2-good-old-rev0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ext2 Rev0 superblocks lack dynamic fields. Add fallback logic to check for EXT2_GOOD_OLD_REV and manually populate in-memory inodeSize (128) and firstInode (11).
Introduce standard EXT2_GOOD_OLD_* constants aligning with Linux kernel approach for the same issue.
This aligns with what the Linux Kernel does.
@Matou1306, were you able to find or create a revision 0 FS to test this change?
7972a6bafftobddaf56c95@Matou1306, what about the fields s_feature_compat, s_feature_incompat, and s_feature_ro_compat? If I understand correctly, they are present only in revision 1 superblocks, but the current code reads them always. Do I miss anything?
@dunkaist For the features they don't cause any errors in the original rev0. The usable superblock fields were indeed only 84 bytes but the superblock size is 1024, so the remaining is explicitly zeroed out.
I also made the test and opened a PR on umka, it only tests ls70, without the fix this outputs file system error, with the fix it reads it normally. I tried read70 but it resulted in access denied (I guess that's because it's the superblock)
I created the image with mkfs but manually matched the rev0 partition style from the hdd loop device you sent me before.
Is this guaranteed by the spec for all cases, or is it so just for the particular test image?
I saw the linux kernel completely ignores this, so it seems like it is indeed filled out with 0s. Not doing so can also be a vulnerability since the garbage data that would've been filled isn't actually garbage and might contain sensitive data, writing this to the disk wouldn't have been a safe practice