logoalt Hacker News

Exploring building a tiny FUSE filesystem

71 pointsby shayonjlast Friday at 4:38 PM13 commentsview on HN

Comments

fweimertoday at 4:29 PM

The glibc test suite contains a few tiny FUSE file systems. For example, there is one that just happens to contain every file that mkstemp attempts to create, for a test that exercises the O_CREAT|O_EXCL failure path. Like the Rust fuser crate, it uses the kernel API directly. The tests are slightly brittle because sometimes we encounter a new LSM that triggers unexpected file system operations, but it's not too bad overall.

What I found funny when I discovered it is that you can create a thread in the same process that provides the FUSE file system implementation for this very process. It makes it much easier to write certain tests, especially debugging. We had to teach valgrind that more system calls effectively perform callbacks into the same process, but fortunately valgrind already had a FUSE_COMPATIBLE_MAY_BLOCK mechanism for that.

show 1 reply
oakinnagbetoday at 12:19 PM

The older I get, the more I appreciate posts that are basically I wanted to understand X, so I built a tiny version of it.

beratbozkurt0today at 8:09 AM

I don't know why, but I really enjoy reading this kind of content. I admire the people who implement and maintain this system.

show 1 reply
direwolf20today at 2:48 PM

Kernel FUSE documentation is a dead link

show 1 reply
scorpioxytoday at 9:03 AM

Can someone tell me if this is LLM generated content or not? I tried to look for obvious signs but didn't notice anything.

show 4 replies