ext4 filenames are arbitrary bytes, but FSKit wants UTF-8 (FSFileName.string is nil for anything that isn't). So if a directory has an entry whose name isn't valid UTF-8 — trivial to create from Linux — we skip it entirely during enumeration and refuse to look it up. It's invisible from macOS, and worse: a directory containing only such entries reports ENOTEMPTY on rmdir even though Finder shows it empty.
FSFileName can carry raw bytes via FSFileName(data:), so the fix is to stop requiring valid UTF-8 end to end — build lwext4 paths from the raw bytes and pack enumeration entries with FSFileName(data:) so foreign names round-trip. The relevant guards are in Ext4Volume.enumerateDirectory (the String(bytes:encoding:.utf8) skip) and validEntryName.
Decent first issue if you're comfortable with the FSKit name APIs: the change is localized, and the only fiddly part is handling non-UTF-8 bytes in the path you hand to lwext4.
ext4 filenames are arbitrary bytes, but FSKit wants UTF-8 (
FSFileName.stringis nil for anything that isn't). So if a directory has an entry whose name isn't valid UTF-8 — trivial to create from Linux — we skip it entirely during enumeration and refuse to look it up. It's invisible from macOS, and worse: a directory containing only such entries reportsENOTEMPTYonrmdireven though Finder shows it empty.FSFileNamecan carry raw bytes viaFSFileName(data:), so the fix is to stop requiring valid UTF-8 end to end — build lwext4 paths from the raw bytes and pack enumeration entries withFSFileName(data:)so foreign names round-trip. The relevant guards are inExt4Volume.enumerateDirectory(theString(bytes:encoding:.utf8)skip) andvalidEntryName.Decent first issue if you're comfortable with the FSKit name APIs: the change is localized, and the only fiddly part is handling non-UTF-8 bytes in the path you hand to lwext4.