Bug #917
closedvnconfig -l support patch (Re: vn(4) RFC Misc.)
0%
Description
Per my recent email to kernel@, Attached is a little patch to get
vnconfig to list configured / available vn devices adapted from
& imho improved from OpenBSD.
Unless there are objections, I'll probably commit within the next couple
of days - I had a couple of questions / notes though particularly
on the VNIOCGET ioctl kernel code:
- I'm implicitly trusting the input, assuming that this is
checked on kernel copy-in time. Is this a correct assumption
(I didn't have time to track it down)
- The 'struct vn_user' doesn't store the vn file path, so I use the
vfs cache to re-lookup the vnode pointer backing the VN -
is this silly?
Also, I'm not sure if I needed to lock anything before using
the vfs cache, so there might be problems there.
- I've not yet run this under jails, which may mean a path disclosure
problem. Suggestions on fixing this if it is an issue welcome.
- I wasn't quite sure on how to do the swap size calculation for swap
backed vns in some cases & got bored at that point. Should work for
the normal case. Yea, lame excuse, I know.
Tested briefly on a vmware UP VM & vkernel so far.
Next up: Add a mount_vnd interface to vnconfig, after which it
might make sense to move this piece into /usr/src/sbin
instead of usr.sbin.
Files