code in GEOM thread could not use vnode API (Was:
alq_open_flags() panics in _mtx_lock_flags())
Lev Serebryakov
lev at FreeBSD.org
Mon Oct 3 12:19:09 UTC 2011
Hello, Lawrence.
You wrote 3 октября 2011 г., 13:57:04:
> I know nothing about VFS, but wonder if it's something to do with the
> credentials you pass in?
They looks Ok. Not NULL, at least :) I'm passing
"curtrhead->td_ucred".
> Lev, are you able to share your code with us?
Yes, of course. Minimal code, which trigger this error, attached.
Build, load module and PANIC!
This is geom_zero module, which try to create ALQ with name
"/var/log/zero.alq.log" on it load (not creation! So, you don't need
even create such GEOM!). Please note, that "init" callback of GEOM
class is called in g_event GEOM thread.
Code is for 9.0/10.0
My code is rewritten with usage of working thread already, and it
works without any panic. But worker thread looks like overkill for
simple case "write 24 bytes record to ALQ for each BIO" to me.
So I could prove, that this code PANIC because alq_open_flags() is
called from one of three GEOM threads.
--
// Black Lion AKA Lev Serebryakov <lev at FreeBSD.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g_alq.c
Type: application/octet-stream
Size: 3251 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20111003/fe0910e5/g_alq.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 299 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20111003/fe0910e5/Makefile.obj
More information about the freebsd-fs
mailing list