tech-kern archive

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

iodone not being called


ÂÂ I'm trying to make an alternative way of getting root on a
cgd-device, since the init chroot method is unstable on netbsd/amd64
for me.

ÂÂ In the proof-of-concept I simply want to get a hardcoded (in the
kernel) cgd unit to be configured prior to root bing mounted.

ÂÂ Essentially, what I've done is:
ÂÂ - Create a static 'earlyinit' integer variable in dev/cgd.c and set it to 1.
ÂÂ - Create an mycgdinit() in cgd which is called prior to root being
mounted and which sets up the appropriate ioctl data buffer and calls
cgd_ioctl_set(), and afterwards sets earlyinit to 0.
ÂÂ - The earlyinit variable is used to determine if the vnode
structures are available. (I don't remember the details, but I believe
vn_open() fails if root hasn't been mounted (due to the missing
vfs-stuff, I assume)). In case earlyinit is true, {c,b}dev_open() (and
friends) are used directly, rather than VOP_*.

ÂÂ The problem I've encountered is that in the very end of cgdstart(),
I've replaced a VOP_STRATEGY() with a bdev_strategy() (during
earlyinit), but when this code runs, cgdiodone() is never called.

ÂÂ Considering the existence of bdev_strategy() (and the fact that
VOP_STRATEGY() sooner or later ends up in it) I'm assuming that what
I'm doing is a legal operation. But I'm also assuming that I'm missing
something, since it doesn't work.

ÂÂ Anyone know what I'm missing?

ÂÂ Any hints/tips are welcome.

ÂÂ I can post a diff, in case it would help.

Home | Main Index | Thread Index | Old Index