]> git.proxmox.com Git - mirror_spl-debian.git/commit
Fix taskq_wait() not waiting bug
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 15 Mar 2009 22:13:49 +0000 (15:13 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 15 Mar 2009 22:13:49 +0000 (15:13 -0700)
commit7257ec41856cf54d47a85f786f06e5a3c330acfc
treedffd1f1c2f6472db2621603d1fd6eddb7104b7eb
parent5b5f5685033b60cbd698c68b11d67150426587f5
Fix taskq_wait() not waiting bug

I'm very surprised this has not surfaced until now.  But the taskq_wait()
implementation work only wait successfully the first time it was called.
Subsequent usage of taskq_wait() on the taskq would not wait.

The issue was caused by tq->tq_lowest_id being set to MAX_INT after the
first wait completed.  This caused subsequent waits which check that the
waiting id is less than the lowest taskq id to always succeed.  The fix
is to ensure that tq->tq_lowest_id is never set larger than tq->tq_next.id.

Additional fixes which were added to this patch include:
1) Fix a race by placing the taskq_wait_check() in the tq->tq_lock spinlock.
2) taskq_wait() should wait for the largest outstanding id.
3) Multiple spelling corrections.
4) Added taskq wait regression test to validate correct behavior.
include/sys/taskq.h
module/spl/spl-taskq.c
module/splat/splat-taskq.c