Christopher Sedore wrote: > > One other thing which should be noted in the docs, or fixed in the kernel. > The aiocb struct should be bzeroed before an aio_read or aio_write because > if you happen to have garbage in the private part of the structure, the io > can be synchronous (look at the first few lines of aio_read in > src/kern/vfs_aio.c for the code). I think this is a probably a standards > violation, but have not done the legwork to find out. In any case, its a > pain in the neck until you root around in the kernel source to find out > why some io ops run synchronously... > > I'd be happy to generate a patch for the kernel code to fix this, if > desired.
OK, I've added a warning to zero the iocb in the RESTRICTIONS subheading and a warning about bugs context in iocb->_aiocb_private in the BUGS subheading. Anyone reviewing these should probably refresh. I guess you're proposing bzeroing iocb->_aiocb_private near the start of aio_read and aio_write? It looks to me like this would solve the problem neatly, but since these are pretty much bare syscalls I don't know how to add this. Doing it inside the kernel seems unnecessary; this should be done in userland. A lesson on how to do so would be a great learning experience for me. ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.softweyr.com/~softweyr w...@softweyr.com To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message