Skip to content

Commit

Permalink
Add assert under lock to detect cases of dispach of a preallocated
Browse files Browse the repository at this point in the history
taskq work item to more than one queue concurrently. Also, please
see discussion in openzfs#3840.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Closes openzfs#609
  • Loading branch information
bprotopopov authored and behlendorf committed Aug 8, 2017
1 parent cce83ba commit 9243b0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/spl/spl-taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,12 @@ taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,

spin_lock(&t->tqent_lock);

/*
* Make sure the entry is not on some other taskq; it is important to
* ASSERT() under lock
*/
ASSERT(taskq_empty_ent(t));

/*
* Mark it as a prealloc'd task. This is important
* to ensure that we don't free it later.
Expand Down

0 comments on commit 9243b0f

Please sign in to comment.