aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zio.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 10:32:23 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 08:38:46 -0700
commit5cc556b447380bf5fed181d3aa5f138618cd69c8 (patch)
tree3af4f4d688c0ff2cb4579f46cdfb4277b2ec2db7 /module/zfs/zio.c
parent2a442d1629e5405efe82b832d06f69e8d1360cc7 (diff)
Fix zio_taskq_dispatch to use TQ_NOSLEEP
The zio_taskq_dispatch() function may be called at interrupt time and it is critical that we never sleep. Additionally, wrap taskq_dispatch() in a while loop because it may fail. This is non optimal but is OK for now. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/zio.c')
-rw-r--r--module/zfs/zio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/zio.c b/module/zfs/zio.c
index 2d8c7e9bd..e434cf01a 100644
--- a/module/zfs/zio.c
+++ b/module/zfs/zio.c
@@ -1049,7 +1049,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_taskq_type q, boolean_t cutinline)
{
spa_t *spa = zio->io_spa;
zio_type_t t = zio->io_type;
- int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0);
+ int flags = TQ_NOSLEEP | (cutinline ? TQ_FRONT : 0);
/*
* If we're a config writer or a probe, the normal issue and
@@ -1073,8 +1073,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