I ran into a situation where a ZFS system replicated to a second system, and then to a third system, resulted in all of the boot environments being mounted on /mnt at the same time. This was not what I had desired. I discussed with Alan Jude to make sure I didn't miss anything (it still happens), and we discussed a couple of attacks. That leads to this proposed change, which adds to mount options, neither of which apply to MNT_UPDATE:
- nocover -- fail with EBUSY if the requested mount point is already the root of a mount point.
- emptydir -- fail with ENOTEMPTY if the requested mount point directory is not empty.
(As a note: I first implemented the latter using a new VOP, but while that would have been faster with ZFS, it would have been about the same with UFS.)
The next step in this would be to add support for ZFS to have one or more of these as a default, but that'd be done via changes to ZFS.