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
F140007444: D53086.id167378.diff
Thu, Dec 18, 11:02 PM
F140007438: D53086.id167576.diff
Thu, Dec 18, 11:02 PM
F140007419: D53086.id164154.diff
Thu, Dec 18, 11:02 PM
Unknown Object (File)
Tue, Dec 16, 5:41 PM
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)
Nov 18 2025, 9:31 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 67769
Build 64652: 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?