Fix taskq_dispatch() call in zio_taskq_dispatch().

The feature branch 'fix-taskq' in Linux's ZFS tree changes the taskq_dispatch()
flag from TQ_SLEEP to TQ_NOSLEEP to avoid sleeping in some circumstances.

However, this has the side effect that taskq_dispatch() now may fail, and since
the return code was not even being checked, it could lead to zio's not being
scheduled to execute.

I'm fixing this in a simplistic but not very elegant way, by just looping until
taskq_dispatch() succeeds.

Signed-off-by: Ricardo M. Correia <ricardo.correia@oracle.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Ricardo M. Correia 2010-08-02 11:32:47 -07:00 committed by Brian Behlendorf
parent bc23a8b10f
commit 4ca4dfe9bb
1 changed files with 3 additions and 2 deletions

View File

@ -1072,8 +1072,9 @@ zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
q++;
ASSERT3U(q, <, ZIO_TASKQ_TYPES);
(void) taskq_dispatch(spa->spa_zio_taskq[t][q],
(task_func_t *)zio_execute, zio, flags);
while (taskq_dispatch(spa->spa_zio_taskq[t][q],
(task_func_t *)zio_execute, zio, flags) == 0); /* do nothing */
}
static boolean_t