Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Nov 2014 01:42:28 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274303 - head/cddl/contrib/opensolaris/lib/libzpool/common
Message-ID:  <201411090142.sA91gSBW062355@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Sun Nov  9 01:42:28 2014
New Revision: 274303
URL: https://svnweb.freebsd.org/changeset/base/274303

Log:
  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

Modified:
  head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c

Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Sun Nov  9 00:43:14 2014	(r274302)
+++ head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c	Sun Nov  9 01:42:28 2014	(r274303)
@@ -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 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411090142.sA91gSBW062355>