ips - Mark queue_lock as LK_CANRECURSE
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Sun, 18 Apr 2010 02:59:11 +0000 (11:59 +0900)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Sun, 18 Apr 2010 02:59:11 +0000 (11:59 +0900)
Originally queue_lock was an LWKT reader-writer locks, which permitted
multiple locks by the same thread, and in fact there are few code paths
where such multiple locking is used.  Doing the similar thing with lockmgr
lock without either LK_NOWAIT or LK_CANRECURSE triggers a panic.

sys/dev/raid/ips/ips_pci.c

index bdb1e10..ce34d4b 100644 (file)
@@ -154,7 +154,7 @@ ips_pci_attach(device_t dev)
        sc->ips_ich.ich_func = ips_intrhook;
        sc->ips_ich.ich_arg = sc;
        sc->ips_ich.ich_desc = "ips";
-       lockinit(&sc->queue_lock, "ipslk", 0, 0);
+       lockinit(&sc->queue_lock, "ipslk", 0, LK_CANRECURSE);
        bioq_init(&sc->bio_queue);
        if (config_intrhook_establish(&sc->ips_ich) != 0) {
                kprintf("IPS can't establish configuration hook\n");