summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-11-09 01:42:28 +0000
committerdelphij <delphij@FreeBSD.org>2014-11-09 01:42:28 +0000
commitce17e1128b9651166225d52c6f3a52b89a048716 (patch)
treed5d7141bf3b6bcc83506392dc249ddeb41dcb179 /cddl
parent61303c568a276b169691c79f829d3d0ec3127e4f (diff)
downloadFreeBSD-src-ce17e1128b9651166225d52c6f3a52b89a048716.zip
FreeBSD-src-ce17e1128b9651166225d52c6f3a52b89a048716.tar.gz
Apply upstream 13597:3eac1e8e0f4c (git: illumos-gate@aa846ad9):
Initialize tqent_flags in the userland taskq implementation. Without this the assertion of tq->tq_freelist != NULL may fail in taskq_destroy. The problem is that tqent_flags is never initialized in the userland implementation while the kernel one does initialize it. Without proper initialization, the flag may have its lowest bit set, making it treated as TQENT_FLAG_PREALLOC and never removing taskq_ent_t from tq_freelist. MFC after: 2 weeks
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/taskq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c b/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
index d4036d0..785f106 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
@@ -24,6 +24,7 @@
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved.
*/
#include <sys/zfs_context.h>
@@ -136,6 +137,7 @@ taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
t->tqent_prev->tqent_next = t;
t->tqent_func = func;
t->tqent_arg = arg;
+ t->tqent_flags = 0;
cv_signal(&tq->tq_dispatch_cv);
mutex_exit(&tq->tq_lock);
return (1);
OpenPOWER on IntegriCloud