Date: Fri, 11 Mar 2005 12:33:51 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: freebsd-current@freebsd.org Subject: crypto_q_mtx recursion. Message-ID: <20050311113351.GC9291@darkness.comp.waw.pl>
index | next in thread | raw e-mail
[-- Attachment #1 --]
Hi.
I had a panic related to mutex recursion, the code path is as follows:
crypto_dispatch()
CRYPTO_Q_LOCK()
crypto_invoke()
crypto_done()
cryptodev_cb() (via crp->crp_callback)
crypto_dispatch()
CRYPTO_Q_LOCK() <- recursion.
Not sure how to fix it. Calling 'locked' version of crypto_dispatch()
is not an option, as we can call cryptodev_cb() with or without
crypto_q_mtx held.
The only fix I can came up with right not is a "pseudo-recursion" in
crypto_dispatch():
int unlock = 0;
[...]
if (!mtx_owned(&crypto_q_mtx)) {
unlock = 1;
CRYPTO_Q_LOCK();
}
[...]
if (unlock)
CRYPTO_Q_LOCK();
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFCMYIfForvXbEpPzQRAsCtAJ9aaGcM8dzT/jnHGxAmrNyPhx98vACdGC99
7o/U8Lch2UJZ5ZWOe03U7qw=
=Iakb
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050311113351.GC9291>
