]> git.proxmox.com Git - mirror_spl.git/commitdiff
Add assert under lock to detect cases of dispach of a preallocated
authorBoris Protopopov <bprotopopov@users.noreply.github.com>
Tue, 8 Aug 2017 15:31:52 +0000 (11:31 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 8 Aug 2017 15:31:52 +0000 (08:31 -0700)
taskq work item to more than one queue concurrently. Also, please
see discussion in zfsonlinux/zfs#3840.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Boris Protopopov <boris.protopopov@actifio.com>
Closes #609

module/spl/spl-taskq.c

index 4298b3c86e3ed6a918928a41d0cd7eae48e471eb..7cad9f76b54327ba66516a0c90913353560a1d08 100644 (file)
@@ -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.