Re: git: 10037d0978f8 - main - fusefs: Implement support for the auto_unmount option kernel-side

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Sun, 01 Feb 2026 21:18:53 UTC
On Sun, Feb 01, 2026 at 10:27:41PM +0300, Gleb Popov wrote:
> On Sun, Jan 25, 2026 at 10:39 PM Konstantin Belousov
> <kostikbel@gmail.com> wrote:
> >
> >
> > > +             vfs_ref(fdata->mp);
> > Don't you need to take the reference when the fdata is created and mp member
> > is initialized, and not here?
> >
> > What guarantees that the mp is still ours?
> > In fact, I think that you should use vfs_busy() and not vfs_ref(),
> > since what prevents mp from being unmounted under us?
> 
> Using vfs_busy() before dounmount() results in a soft hang:
> - vfs_busy increments mp->mnt_lockref in
> https://github.com/freebsd/freebsd-src/blob/98bdf63f6e94be42a1787de73608de15bcb3419a/sys/kern/vfs_subr.c#L929
> - dounmount spins until mp->mnt_lockref becomes 0 in
> https://github.com/freebsd/freebsd-src/blob/98bdf63f6e94be42a1787de73608de15bcb3419a/sys/kern/vfs_mount.c#L2318-L2322
> 
> This results in a FUSE process to hang in the "mount drain" state.

Ok, change it to the mnt_ref() done when assigning to fdata->mp for now,
please.