]> granicus.if.org Git - zfs/commitdiff
Fix bug in SPLAT taskq:front
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 30 Sep 2014 21:47:10 +0000 (17:47 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 3 Oct 2014 17:42:20 +0000 (10:42 -0700)
While running SPLAT on a kernel with CONFIG_DEBUG_ATOMIC_SLEEP
enabled the taskq:front was flagged as a test which might sleep
which in an unsafe context.  Specifically, the splat_vprint()
function which internally takes a mutex was being called under
a spin lock.  Moving the log function outside the spin lock
cleanly solves this issue.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/splat/splat-taskq.c

index 074af895b2f031b706fe14ea9b44220046683bf1..33e49b2f124516f5c1927a51c58b2298397d414f 100644 (file)
@@ -814,10 +814,11 @@ splat_taskq_test6_func(void *arg)
        spin_lock(&tq_arg->lock);
        tq_arg->order[tq_arg->flag] = tq_id->id;
        tq_arg->flag++;
+       spin_unlock(&tq_arg->lock);
+
        splat_vprint(tq_arg->file, tq_arg->name,
                     "Taskqid %d complete for taskq '%s'\n",
                     tq_id->id, tq_arg->name);
-       spin_unlock(&tq_arg->lock);
 }
 
 static int