szastupov/illumos-gate — comment on commit 152f38d75fbf953b27e419cb0f1f0a23a0e22bd7
File: usr/src/uts/common/fs/sharefs/sharefs_vfsops.c line 246
By dan-kruchinin:

I guess that the check was added in order to prevent unmountig of sharetab when it has some active entries. Just imagine a situation when you have some active shares (mentioned in sharetab) and then you unmount sharetab. In this case share and sharemgr commands will show you irrelevant information. I.e. making it possible to unmount sharetab with active entires will allow to break some parts of the system functionality and I think it's wrong.
I think there's some logic in user-space that should remove shares from sharetab if (and only if) you unmount filesystem.
It seems that zfs_unmount() does that.