Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Jan 2022 17:40:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 260894] Nonexportable file systems are usable over NFSv4
Message-ID:  <bug-260894-3630-LIgQskmMJf@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-260894-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-260894-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260894

--- Comment #9 from Alan Somers <asomers@FreeBSD.org> ---
So it turns out that I can't use VFS_MOUNT the way I thought.  The MNT_EXPO=
RTED
flag does not get set during that call if because the user wants to export =
the
file system.  Rather, it is set if the file system is _already_ exported.  =
The
sequence goes like this:

1) mountd calls nmount with MNT_EXPORTED to export the file system
2) vfs_domount_update calls VFS_MOUNT with the MNT_EXPORTED bit masked out
3) vfs_domount_update calls vfs_export, which actually sets MNT_EXPORTED in=
 the
struct mount.
4) At some later date, if the user removes the file system from /etc/export=
s,
mountd will call nmount with MNT_EXPORTED unset.
5) vfs_domount_update calls VFS_MOUNT, which sees MNT_EXPORTED set, and ret=
urns
an error
6) As a result, the file system does not get unexported

I guess for now I can't do anything smart in VFS_MOUNT.  Instead, I'll just
have to return errors from VOP_VPTOFH.  As an enhancement, it would be nice=
 if
the file system could set some flag that would cause vfs_export to fail.  T=
hat
would produce a more useful error message than just returning errors from
VOP_VPTOFH .

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-260894-3630-LIgQskmMJf>