Page MenuHomeFreeBSD

fusefs: draft kernel-based implementation of auto_unmount
Needs ReviewPublic

Authored by arrowd on Oct 14 2025, 4:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 31, 1:46 AM
Unknown Object (File)
Tue, Dec 30, 10:15 AM
Unknown Object (File)
Fri, Dec 26, 3:06 AM
Unknown Object (File)
Thu, Dec 25, 11:14 PM
Unknown Object (File)
Sun, Dec 21, 10:12 PM
Unknown Object (File)
Sun, Dec 21, 7:39 PM
Unknown Object (File)
Sat, Dec 20, 9:47 AM
Unknown Object (File)
Thu, Dec 18, 11:02 PM
Subscribers

Details

Reviewers
asomers
Summary

As it was suggested in D51549 here goes an attempt to implement the auto_unmount feature from within the kernel.

Corresponding libfuse changes are there: https://github.com/libfuse/libfuse/compare/master...arrowd:libfuse:kernel-bsd-auto-unmount

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69066
Build 65949: arc lint + arc unit

Event Timeline

  • Fix hang by marking fdata dead

I have fixed the hang, but the filesystem still does not get unmounted.

  • Replace VOP_UNMOUNT with dounmount
  • Plunk vfs_ref before to avoid deadlock

This implementation seems to work now

sys/fs/fuse/fuse_vfsops.c
421

It seems to be too late to arm this flag there. I guess I'll have to set it from userspace.

  • Use cdev destructor to clean up the mount point instead of a .d_close method

This seems to work now. The change turned out to be surprisingly small.

@asomers Could you take a look?