r330994 avg March 15, 2018, 12:42 p.m.
r330993 avg March 15, 2018, 12:40 p.m.
The change is to account for a different order in which the recursive
destroy may be attempted.  If we first try a dataset that can be destroyed
then it will be destroyed, but if we first try a dataset that cannot be
destroyed then we will not attempt to destroy the other dataset.
r330992 avg March 15, 2018, 12:35 p.m.
r330979 avg March 15, 2018, 9:28 a.m.
The test was disabled in r329408.

PR:		225960
r330977 avg March 15, 2018, 9:16 a.m.
The problem is that g_access() must be called with the GEOM topology
lock held.  And that gives a false impression that the lock is indeed
held across the call.  But this isn't always true because many classes,
ZVOL being one of the many, need to drop the lock.  It's either to
perform an I/O on the first open or to acquire a different lock (like in

That, of course, can break many assumptions.  For example,
g_slice_access() adds an extra exclusive count on the first open. As
described above, an underlying geom may drop the topology lock and that
would open a race with another thread that would also request another
extra exclusive count.  In general, two consumers may be granted
incompatible accesses.

To avoid this problem the code is changed to mark a geom with special
flag before calling its access method and clear the flag afterwards.  If
another thread sees that flag, then it means that the topology lock has
been dropped (either by the geom in question or downstream from it), so
it is not safe to make another access call.  So, the second thread would
use g_topology_sleep() to wait until the flag is cleared and only then
would it proceed with the access.

Also see http://docs.freebsd.org/cgi/mid.cgi?809d9254-ee56-59d8-69a4-08838e985cea

PR:		225960
Reported by:	asomers
Reviewed by:	markj, mav
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D14533
r330975 avg March 15, 2018, 8:52 a.m.
The test was disabled in r329248.

PR:		225877
r330974 avg March 15, 2018, 8:49 a.m.

  This issue has been reported by Alan Somers as

  dmu_objset_refresh_ownership() first disowns a dataset (and releases
  it) and then owns it again. There is an assert that the new dataset
  object is the same as the old dataset object.  When running ZFS Test
  Suite on FreeBSD we see this panic from zpool_upgrade_007_pos test:

  panic: solaris assert: newds == os->os_dsl_dataset (0xfffff80045f4c000
  == 0xfffff80021ab4800)

  I see that the old dataset has dsl_dataset_evict_async() pending in
  ds_dbu.dbu_tqent and its ds_dbuf is NULL.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Don Brady <don.brady@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andriy Gapon <avg@FreeBSD.org>

PR:		225877
Reported by:	asomers
MFC after:	1 week
r330971 wma March 15, 2018, 6:19 a.m.
r330970 tsoome March 15, 2018, 5:58 a.m.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D14696
r330963 mav March 15, 2018, 1:07 a.m.
It seems default timeout of 100ms is not enough for my 2694L card,
while it was perfectly fine for others, even for full-height 2694.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
r330962 emaste March 15, 2018, 12:57 a.m.
Clang will compile both amd64 and i386 with retpoline.

Sponsored by:	The FreeBSD Foundation
r330957 jkim March 14, 2018, 11:45 p.m.
r330956 jkim March 14, 2018, 11:42 p.m.
These macros were added in ACPICA 20051216, more than a decade ago.
r330955 imp March 14, 2018, 11:28 p.m.
Also, fix an unnecessary deref to get ctrlr.

Noticed by: rpokala@
Sponsored by: Netflix
r330954 imp March 14, 2018, 11:01 p.m.
The NVME standard has required in section 7.2.6, since at least 1.1,
that a clean shutdown is signalled by deleting the subission and the
completion queues before setting the shutdown bit in CC. The 1.0
standard, apparently, did not and many of the early Intel cards didn't
care. Some newer cards care, at least one whose beta firmware can
scramble the card on an unclean shutdown. Linux has done this for some
time. To make it possible to move forward with an evaluation of this
pre-release card with wonky firmware, delete the queues on the card
when we delete the qpair structures.

Sponsored by: Netflix