]> git.proxmox.com Git - mirror_spl.git/commitdiff
Fix taskq_wait_outstanding re-evaluate tq_next_id
authorChunwei Chen <david.chen@osnexus.com>
Mon, 23 May 2016 21:12:22 +0000 (14:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 24 May 2016 20:02:10 +0000 (13:02 -0700)
wait_event is a macro, so the current implementation will cause re-
evaluation of tq_next_id every time it wakes up. This would cause
taskq_wait_outstanding(tq, 0) to be equivalent to taskq_wait(tq)

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Issue #553

module/spl/spl-taskq.c

index 9784473bde76025410a5680fbe2696676e2e285b..320ad391448adbd39c8870210dfc87960f8019c2 100644 (file)
@@ -447,8 +447,8 @@ taskq_wait_outstanding_check(taskq_t *tq, taskqid_t id)
 void
 taskq_wait_outstanding(taskq_t *tq, taskqid_t id)
 {
-       wait_event(tq->tq_wait_waitq,
-           taskq_wait_outstanding_check(tq, id ? id : tq->tq_next_id - 1));
+       id = id ? id : tq->tq_next_id - 1;
+       wait_event(tq->tq_wait_waitq, taskq_wait_outstanding_check(tq, id));
 }
 EXPORT_SYMBOL(taskq_wait_outstanding);