News for hackers. Stuff that matters.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by Reason077 on Tuesday December 26, 2023 @03:51PM (#38775930)
It’s surprising that given Apple’s war on kexts, they still haven’t come out with a proper API for implementing local user-space filesystems. It seems like this exists for remote filesystems (eg: Google Drive, Dropbox), but not for filesystems on local storage devices?

This sounds like a nice workaround, though!

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by duped on Tuesday December 26, 2023 @04:09PM (#38776086)
> they still haven’t come out with a proper API for implementing local user-space filesystems.

They have, it's called a File Provider Extension (0). The major downside is that it's extremely limited in what you can provide and it's an extension of the interface on top of APFS and not a proper file system in user space.

Frankly, I don't think Apple cares about creating features that would interfere with their own offerings. User space file systems (to them) are for remote storage. Users should use iCloud. Apps that can't shim over iCloud should be file provider extensions.

If your app doesn't fit in those boxes then Apple doesn't care about providing the APIs to implement it cleanly on their platform. You can hack it through NFS.

(0) https://developer.apple.com/documentation/fileprovider

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by comex on Tuesday December 26, 2023 @04:50PM (#38776460)
I'm not sure "interfere with their own offerings" is quite the right framing. It's more about "going beyond their imagined use case".

iCloud Drive is a File Provider. Third-party services that want to do the same kind of file syncing as iCloud Drive, and thus compete it with it, can. And there are several highly-popular competitors that have recently moved to File Provider, like Dropbox and Google Drive. But when they did so they had to lose some functionality, like the ability to store data on an external drive [1]. And for the less popular use case of third-party filesystems that aren't just for syncing, File Provider is completely inapplicable.

The box covers most of the use cases that most users are using third-party filesystems for. But it's shrink-wrapped around those use cases – no room to invent new ones.

[1] https://talk.tidbits.com/t/dropbox-drops-support-for-storing...

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by duped on Tuesday December 26, 2023 @08:05PM (#38777889)
My point is their view of a file provider is as a remote file storage API. This is one of the use cases of a file system in user space, but quite different from them generally. Most of the interesting use cases that FUSE covers are completely unsupported by the File Provider API.

And I believe this is because they want anything that might be useful but competitive with the features they provide their users to be hamstrung by the same design contraints of iCloud and APFS.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by lxgr on Wednesday December 27, 2023 @05:27AM (#38780691)
I'm not opposed to pointing fingers at Apple when it's justified, but I believe in this case it's really just a matter of priorities.

My guess is that the number of users that use remote file storage providers is just much larger than that of users using actual (non-SMB) network or local (non-(ex)FAT) file systems, so they created a kext replacement for that use case first.

If anything, the File Provider API levels the playing field between iCloud and third-party remote storage providers, since the neat APFS tricks they can use to implement it would otherwise be unavailable to third party developers. For example, I find Google Drive to be much more well-behaved on File Provider than it ever was when using FUSE (I blame it for some hangs or kernel panics) or SMB (which was more stable, but did not support Spotlight at all).

For all the other use cases, I'm hopeful that we'll be seeing a real macOS FUSE sooner rather than later.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by lxgr on Wednesday December 27, 2023 @05:10AM (#38780602)
File Provider is really an API optimized for "synchronizing file systems" (i.e. network file systems with an explicit local cache, e.g. something like Google Drive or Dropbox).

It doesn't seem like a great fit for either network file systems or local file systems: There's mandatory caching, which means everything remote accessed locally is written to disk at least once (completely useless and actively counterproductive for e.g. a local ext4 driver, which is something I dearly miss for fixing Raspberry PI root volumes), and I'm not sure if there's a way to implement remote file locks either.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by rgovostes on Tuesday December 26, 2023 @03:58PM (#38775994)
Yes, an Apple-supported API is likely coming. They’ve been gradually providing userspace alternatives for kernel extensions. Their API isn’t likely to be FUSE but hopefully the community will develop a translation layer.

I wonder if one of the holdups is that they don’t want a profusion of filesystems and would prefer everyone use ExFAT or APFS. Data loss/corruption ultimately results in more support calls and headaches for them, after all.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by tambourine_man on Tuesday December 26, 2023 @06:01PM (#38777036)
It’s been coming for so long that I lost hope.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by macshome on Tuesday December 26, 2023 @06:20PM (#38777148)
Apple started replacing their own file system (and networking) kexts with user-mode file systems in macOS 13. Right now its locked up behind some private entitlements though. Hopefully they open it up more in the future.

For a quick overview check out a blog post on threedots. https://threedots.ovh/blog/2022/06/quick-look-at-user-mode-f...

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by strangemonad on Tuesday December 26, 2023 @06:49PM (#38777368)
It’s certainly been interesting watching the multi-decade arc play out. With Mach as the origins, everything other than tasks (processes) schedule and virtual mem was out of kernel and done over Mach port comms. Then xnu via next step and later OS X linked much more in kernel and exposed specific data types using com+ in iokit. And now more and more is moving back out of the kernel.

io_urging networking on Linux is another similar move out to use space

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by detourdog on Tuesday December 26, 2023 @07:23PM (#38777599)
Its my favorite part of watching the mac evolve. The man hours that has been used in the development is staggering.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by HHad3 on Wednesday December 27, 2023 @05:01AM (#38780562)
The linked msdos source code on GitHub has since been rewritten by Apple /again/ [1], so the article is a bit out of date. This happened 3 months ago, and it now plugs into a private framework named FSKit.

I did not immediately see any private entitlements that restrict access to this API, nor is msdos.fs signed with special entitlements on my machine. Chances are this API works for any filesystem by dropping an appex into /Library/Filesystems. Looking forward to this being documented and made public eventually.

[1] https://github.com/apple-oss-distributions/msdosfs/blob/423d...

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by rgovostes on Wednesday December 27, 2023 @06:27PM (#38788146)
Thanks. I was aware of FAT being the first filesystem in userspace (maybe for iOS devices to mount SD cards?) but did not know it was open source or that FSKit existed. Maybe an enterprising hacker could dump the Obj-C header from that framework and start writing a FUSE translation layer.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by donatj on Tuesday December 26, 2023 @05:33PM (#38776829)
I wish everyone would just standardize on 9p already. It's solid and has existed for going on thirty years.

Microsoft actually uses it for WSL, but afaik does provide the ability to access other 9p servers.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by vbitz on Tuesday December 26, 2023 @06:13PM (#38777107)
9p involves a lot of round trips to create/write files. I benchmarked sshfs using fuse vs. 9p in the kernel and sshfs was significantly faster.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by donatj on Tuesday December 26, 2023 @08:57PM (#38778241)
Perfect is the enemy of good, and 9p is great.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by speed_spread on Tuesday December 26, 2023 @11:41PM (#38779145)
That's not an argument here. If starting from scratch, might as well go with the thing that works best. Ssh is not an obscure protocol. If it's faster than 9p, that's what I'll use.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by coldtea on Wednesday December 27, 2023 @03:58AM (#38780268)
Any rational reason you like it?
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by dmw_ng on Wednesday December 27, 2023 @04:24AM (#38780404)
That sound you hear is the hellish screeching of a million git status monorepo users waiting for their shell prompt to reappear
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by the8472 on Tuesday December 26, 2023 @09:52PM (#38778568)
9p is a network protocol. For machine local filesystems one can do better by making use of shared memory which fuse and virtio-fs do.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by donatj on Tuesday December 26, 2023 @10:05PM (#38778650)
It's a network protocol as far as everything from Plan9 was designed to be able to operate over the network in the late 90s sense of " the network is the computer". The local file system of Plan 9 though is exposed locally through 9p
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by murderfs on Tuesday December 26, 2023 @10:13PM (#38778702)
Yeah, and that's one of the reasons plan9 was dogshit and never amounted to anything. "Everything is a file" is bad enough, "Everything is a file which might be 'transparently' across a network" is insane.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by tadfisher on Wednesday December 27, 2023 @01:13AM (#38779543)
Classic blocking I/O is the problem, not network transparency. If you don't want files to be transparent through latency/throughput boundaries, then you should also disable the VFS cache.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by pzmarzly on Wednesday December 27, 2023 @02:11AM (#38779790)
Filesystem cache may make latency unpredictable, but it won't make open() unexpectedly fail with ECONNREFUSED. Most programs barely handle ENOENT, let alone EINTR.

Also, how do you do async fstat and mkdir in Linux? I don't see it in manpages.

AFAIK Plan9 answers to that was to not implement POSIX interfaces, and instead all I/O looked like RPC calls. This is generally a good design idea, but it's hard to sell an OS where all existing software will have to be rewritten for.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by GoblinSlayer on Wednesday December 27, 2023 @04:07AM (#38780310)
Conceptually it's possible: async fstat sets pending read, then epoll could return read flag when it completes, after that fstat completes without delay.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by the8472 on Wednesday December 27, 2023 @04:16PM (#38786838)
> Also, how do you do async fstat and mkdir in Linux? I don't see it in manpages.

io_uring. and a virtual filesystem may have to serve multiple concurrent requests from several threads. so even if individual IO calls are blocking in the aggregate they still have to be interleaved.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by butterisgood on Wednesday December 27, 2023 @08:19AM (#38781632)
Don't talk about yourself in such ways. I'm sure you had something to contribute to the world before you made this comment.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by Quiark on Tuesday December 26, 2023 @11:37PM (#38779121)
Makes me think how everything including storage is virtualised on AWS, sorta like todays Plan9 :)
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by detourdog on Tuesday December 26, 2023 @07:21PM (#38777586)
The point is that the userspace shoukdnt need a kext.
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by xoa on Tuesday December 26, 2023 @07:50PM (#38777779)
My personal desperate hope/wish is some insurance that iSCSI will continue to work and be somewhat performant, either via an API to deal with the kexts or better yet Apple buying Xtend SAN or developing their own and offering first party support. I'm worried though it's not going to make the cut :(
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by lxgr on Wednesday December 27, 2023 @05:39AM (#38780758)
Isn't it already gone from the most recent macOS releases? Or do you mean Apple providing an API that allows implementing a performant non-kext third party initiator?
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by inkyoto on Tuesday December 26, 2023 @07:58PM (#38777852)
> […] Apple’s war on kexts

Hardly a war, a rather rational decision it is – they are progressively moving kernel modules, drivers, file systems and network components into the user space.

It is a foundational design principle of GNU Hurd where everything, apart from the microkernel server, runs in the user space. Minix 3 followed the same principle, and many other microkernel designs.l as well.

It makes sense from the resilience point of view where a defective kernel module / driver can no longer crash the entire system.

It also makes sense from the security perspective on – the kernel itself is cryptographically sealed off and can't be tampered with.

Previously, the overhead of extra context switches was too high on the old CPU's and hardware, but today's computing devices are fast and the hardware is more optimised, so moving stuff into the user space is viable and incurs a much smaller performance penalty.

Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by mcpackieh on Tuesday December 26, 2023 @08:00PM (#38777862)
"War on __" doesn't imply an irrational war on __
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by iknowstuff on Tuesday December 26, 2023 @08:36PM (#38778114)
Only if you’re a stickler. It does assume an opponent and has a negative connotation
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by viraptor on Tuesday December 26, 2023 @11:45PM (#38779166)
It makes sense if there's some replacement available. Less so, if there's none (unless you're Apple itself of course...)
Re:FUSE-T is a kext-less implementation of FUSE for macOS th... by crest on Wednesday December 27, 2023 @08:24AM (#38781681)
The have the file provider (https://developer.apple.com/documentation/fileprovider/) API. It works by caching the remote files in a system managed cache in APFS. The idea is sound for for Dropbox, GDrive etc, but not a full replacement for FUSE. The nice thing is that it can keep the files locally pre-cached and replicate local changes asynchronously.