diff options
author | Boris Protopopov <[email protected]> | 2017-08-08 11:31:52 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-08-08 08:31:52 -0700 |
commit | 9243b0fb4784803720a0a5336cc3ded969a779e6 (patch) | |
tree | 9d39767d90f9d3d944a613c1ab71ac004501f364 /module | |
parent | cce83ba0ecacc45c79709e8b3def8dc8a046fffe (diff) |
Add assert under lock to detect cases of dispach of a preallocated
taskq work item to more than one queue concurrently. Also, please
see discussion in zfsonlinux/zfs#3840.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Boris Protopopov <[email protected]>
Closes #609
Diffstat (limited to 'module')
-rw-r--r-- | module/spl/spl-taskq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 4298b3c86..7cad9f76b 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -684,6 +684,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. */ |