From: Brian Behlendorf Date: Tue, 30 Sep 2014 21:47:10 +0000 (-0400) Subject: Fix bug in SPLAT taskq:front X-Git-Tag: zfs-0.8.0-rc1~152^2~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81857a34d1d767abf40aea7e6db074d8cbf7b49f;p=zfs Fix bug in SPLAT taskq:front 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 --- diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 074af895b..33e49b2f1 100644 --- a/module/splat/splat-taskq.c +++ b/module/splat/splat-taskq.c @@ -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