From 4ca4dfe9bb6bc12f7724e706a0a166d42665ae5f Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Mon, 2 Aug 2010 11:32:47 -0700 Subject: [PATCH] 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 Signed-off-by: Brian Behlendorf --- module/zfs/zio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 341f00306a..dc3400d3a6 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -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