[issue998] Unconfiguring a vn while it is mounted

Stathis Kamperis (via DragonFly issue tracker) sinknull at crater.dragonflybsd.org
Sun Feb 1 21:00:56 PST 2009


Stathis Kamperis <ekamperi at gmail.com> 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 <bugs at lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue998>
_____________________________________________________





More information about the Bugs mailing list