Stathis Kamperis <[email protected]> added the comment:
On second thoughts, this kind of check should be done in the level of vn(4)
driver itself, under the detach ioctl. By the way, I've been stumbling through
freebsd's repository and they have deprecated vn(4)/vnconfig(8) in favor of
md/mdconfig. md seems to do the right thing:
case MDIOCDETACH:
if (mdio->md_mediasize != 0 ||
(mdio->md_options & ~MD_FORCE) != 0)
return (EINVAL);
sc = mdfind(mdio->md_unit);
if (sc == NULL)
return (ENOENT);
if (sc->opencount != 0 && !(sc->flags & MD_FORCE) &&
!(mdio->md_options & MD_FORCE))
return (EBUSY);
return (mddestroy(sc, td));
Where do we stand ?
Best regads,
Stathis Kamperis
_____________________________________________________
DragonFly issue tracker <[email protected]>
<http://bugs.dragonflybsd.org/issue998>
_____________________________________________________