DragonFly bugs List (threaded) for 2009-02
DragonFly BSD
DragonFly bugs List (threaded) for 2009-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[issue998] Unconfiguring a vn while it is mounted


From: "Stathis Kamperis \(via DragonFly issue tracker\)" <sinknull@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 01 Feb 2009 21:19:14 +0000

Stathis Kamperis <ekamperi@gmail.com> added the comment:

vnconfig supports creating a vnode pseudo disk device AND mounting it at the
same time, in the same line:

vnconfig -e /dev/vn0 lala.img mountro=/mnt/lala
vnconfig -u /dev/vn0

The problem is that when you try to unconfigure it, it only checks if the
mountro= or mountrw= "feature" was passed to it during its invokation. If you
didn't, it assumes that there is no mounted filesystem.

It doesn't take into account that a person could manually mount a vnode device
after vnconfig:

vnconfig /dev/vn0 lala.img
mount -o rdonly /dev/vn0 /mnt/lala
vnconfig -u /dev/vn0

My preliminary work is to introduce a function is_mounted() that *really* checks
if the /dev/vnX to be uncofigured is mounted to the filesystem. And it does by
calling getfsstat() to get a list of actively mounted filesystems.

Patch in:
http://stathisk.ath.cx/0001-Make-vnconfig-u-check-if-vnode-is-mounted-to-fs. patch

It ain't perfect, but it solves the problem for me (well, please test it and
provide feedback). Beside that, I sense that vnconfig's code needs some
refactoring, but let's tackle 1 issue at a time.

Best regards,
Stathis

----------
priority:  -> bug

_____________________________________________________
DragonFly issue tracker <bugs@lists.dragonflybsd.org>
<http://bugs.dragonflybsd.org/issue998>
_____________________________________________________



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]