Userfs
Userfs is a system I wrote in 1993 or so to allow user processes to be
mounted as a normal filesystem. It worked reasonably well, and the
most common use was ftpfs, which allowed anonymous FTP with a filesystem
interface. The code I wrote was basically a proof-of-concept prototype,
and therefore riddled with problems.
I abandoned it in 1996 or so, with the intent of rewriting it using
the lessons learned from the userfs experience. Unfortunately I haven't
had time to do so, so userfs is orphaned. Noone has taken up the
"official maintainer" role, but there have been a number of people hacking
it since.
The code has aged. The last release I made will only work with
1.3/2.0 kernels, and does not compile against glibc. Fixing the glibc
issues are relatively simple, but it would be a fair amount of work to
make it work with 2.1/2.2 kernels.
A post-mortem
So, what were the lessons?
Good things:
-
userfs is practical
-
it is useful for a wide range of applications
-
it's not all that slow
-
I quite like the the OO library for writing filesystems, though I don't
much like C++ these days
-
Avoiding the temptations of shared memory payed for itself many times over
-
Filesystem processes are not root-only things. It's possible to make
it robustly secure and still allow ordinary users to mount their own filesystem
processes
-
I was right not to use NFS
Bad things:
-
"machine independent" protocol was never really machine independent, and
added lots of runtime overhead
-
gencode/genhdr were fun to write, but a real maintenance headache - very
fragile
-
The kernel interface exposed way too much about the kernel implementation,
which made it too sensitive to kernel changes
-
Writing filesystems was too hard, with too much VFS makework
Part of the problem was that when I originally started writing it, userfs
was intended to be a prototyping testbed for filesystems which would eventually
end up in the kernel, which is why it exposed as close to the raw VFS interface
as possible. As time went on, most of the interesting filesystems
were ones which would never go in the kernel, and the VFS-like interface
became a serious liablility. Future userfs-like filesystems should
definitely go with a more abstract filesystem interface.
Resources
Here's an incomplete list of userfs resources:
Back to Jeremy's page
Comments? Questions? Mail me.
Last updated: 4 November 2002