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)
Thu, Dec 11, 4:07 AM
Unknown Object (File)
Fri, Nov 28, 1:44 AM
Unknown Object (File)
Wed, Nov 26, 10:28 PM
Unknown Object (File)
Tue, Nov 18, 9:31 PM
Unknown Object (File)
Nov 12 2025, 9:18 PM
Unknown Object (File)
Nov 8 2025, 5:17 PM
Unknown Object (File)
Nov 8 2025, 2:40 AM
Unknown Object (File)
Oct 30 2025, 6:45 AM
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?