From b3a22a0a005eef22d696cc77baa26ef80d1bdc0c Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Mon, 23 May 2016 14:12:22 -0700 Subject: [PATCH] Fix taskq_wait_outstanding re-evaluate tq_next_id 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 Signed-off-by: Brian Behlendorf Signed-off-by: Tim Chase Issue #553 --- module/spl/spl-taskq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c index 9784473..320ad39 100644 --- a/module/spl/spl-taskq.c +++ b/module/spl/spl-taskq.c @@ -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); -- 2.39.2