Page MenuHomeFreeBSD

fusefs: 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)
Thu, Jan 15, 12:49 PM
Unknown Object (File)
Mon, Jan 5, 5:18 PM
Unknown Object (File)
Sun, Jan 4, 6:06 PM
Unknown Object (File)
Sun, Jan 4, 11:48 AM
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
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?

arrowd retitled this revision from fusefs: draft kernel-based implementation of auto_unmount to fusefs: kernel-based implementation of auto_unmount.Thu, Jan 8, 2:09 PM

Ping.