Search code examples
linuxfilesystemsntfskernel

Is it easier to write filesystem drivers in userspace than in kernel space?


I will use the Linux NTFS driver as an example.

The Linux kernel NTFS driver only has very limited write support in the kernel, and after 5 years it is still considered experimental.

The same development team creates the ntfsmount userspace driver, which has almost perfect write support.

Likewise, the NTFS-3G project which is written by a different team also has almost perfect write support.

Why has the kernel drive taken so much longer? Is it much harder to develop for?

Saying that there already exists a decent userspace application is not a reason why the kernel driver is not compelte.

NOTE: Do not migrate this to superuser.com. I want a programing heavy answer, from a programming perspective, not a practical use answer. If the question is not appropriate for SO, please advise me as to why so I can edit it so it is.


Solution

  • I don't know the inside stories of the NTFS linux driver development but I can imagine some things that would make the userspace development go faster than the kernelspace one:

    • simpler API - the higher level of abstraction provided by userland libraries (memory management, for example) certainly eases the development
    • easier debuging - it's easier to debug a userspace process than debuging the kernel
    • process isolation - this is the one thing I would say is responsible for a faster development in the userspace. Your userspace filesystem driver doing bad things will result, in the worst case, in a corrupted filesystem and your driver process dying, while in kernelspace it could result in a complete system crash. This leads to faster debug cycles, which results in bugs being dealt with faster and faster development overall.