Skip to content

Commit

Permalink
Fix taskq_wait_outstanding re-evaluate tq_next_id
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Issue openzfs#553
  • Loading branch information
Chunwei Chen committed Jun 10, 2016
1 parent 2ef423f commit 7bee9a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/spl/spl-taskq.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,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);

Expand Down

0 comments on commit 7bee9a9

Please sign in to comment.