Skip to content

Commit

Permalink
Fix bug in SPLAT taskq:front
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
behlendorf committed Oct 3, 2014
1 parent e302072 commit 81857a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/splat/splat-taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81857a3

Please sign in to comment.