Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Oct 2015 11:23:09 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288591 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201510031123.t93BN9F7065865@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Oct  3 11:23:08 2015
New Revision: 288591
URL: https://svnweb.freebsd.org/changeset/base/288591

Log:
  MFC r287280 (by delphij):
  In r286705 (Illumos 5960/a2cdcdd), a separate thread is created with curproc
  as parent.  In the case of a send or receive, the curproc would be the
  userland application that issues the ioctl.  This would trigger an assertion
  failure introduced in Solaris compatibility shims in r196458 when kernel is
  compiled with INVARIANTS.
  
  Fix this by using p0 (proc0 or kernel) as the parent thread when creating
  the kernel threads.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Oct  3 11:21:50 2015	(r288590)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Oct  3 11:23:08 2015	(r288591)
@@ -786,7 +786,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp,
 	to_arg.ds = to_ds;
 	to_arg.fromtxg = fromtxg;
 	to_arg.flags = TRAVERSE_PRE | TRAVERSE_PREFETCH;
-	(void) thread_create(NULL, 0, send_traverse_thread, &to_arg, 0, curproc,
+	(void) thread_create(NULL, 0, send_traverse_thread, &to_arg, 0, &p0,
 	    TS_RUN, minclsyspri);
 
 	struct send_block_record *to_data;
@@ -2446,7 +2446,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, 
 	rwa.os = ra.os;
 	rwa.byteswap = drc->drc_byteswap;
 
-	(void) thread_create(NULL, 0, receive_writer_thread, &rwa, 0, curproc,
+	(void) thread_create(NULL, 0, receive_writer_thread, &rwa, 0, &p0,
 	    TS_RUN, minclsyspri);
 	/*
 	 * We're reading rwa.err without locks, which is safe since we are the



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