<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/cmd/ztest, branch zfs-0.6.3</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=zfs-0.6.3</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=zfs-0.6.3'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2014-05-01T22:53:58Z</updated>
<entry>
<title>ztest: Switch to LWP rwlock interface</title>
<updated>2014-05-01T22:53:58Z</updated>
<author>
<name>Richard Yao</name>
<email>ryao@gentoo.org</email>
</author>
<published>2014-04-30T16:51:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7809eb8b65bec8e8ea09b2ea645d320e0b3a1710'/>
<id>urn:sha1:7809eb8b65bec8e8ea09b2ea645d320e0b3a1710</id>
<content type='text'>
ztest is intended to subject the ZFS code in userland to stress that it
should be able to withstand. Any failures that occur when running it are
failures that likely would occur inside the kernel. However, being in
userland, it is much easier to debug them. In practice, this prevents
a large number of problems from reaching production code.

A design decision was made by the original authors of ztest to make a
distinction between userland locking primitives and kernel locking
primitives. The ztest code itself calls userland locking primitives
while the kernel code being run in userland will call emulated kernel
locking primitives that wrap the userland locking primitives.

When ztest was first ported to Linux, a decision was made to use the
emulated kernel interfaces everywhere. In effect, the userland
rw_rdlock()/rw_wrlock() became the kernel rw_enter() and and the userland
rw_unlock() became the kernel rw_exit(). This caused a regression
because of an assertion in rw_enter() to catch recursive locking. That
is permitted in userland, but not in the kernel. Consequently, the ztest
code itself does recursive read locking. The use of the emulated kernel
interfaces consequently caused the following failure:

ztest: ../../lib/libzpool/kernel.c:384: Assertion `rwlp-&gt;rw_owner !=
zk_thread_current() (0x1c87150 != 0x1c87150)' failed.

That occurs because ztest_dmu_objset_create_destroy() will take a read
lock and call ztest_dmu_object_alloc_free(). That will call ztest_io(),
which will take a readlock only when asked to do ZTEST_IO_REWRITE. This
triggered the assertion.

The pthreads rwlock interface was based on the LWP rwlock interface
implemented in Illumos libc. Luckily enough, the subset used by ztest is
almost identical, so we can solve this problem by switching to the LWP
thread rwlock interface in ztest. This eliminates a point of divergence
with Illumos and should make code sharing slightly easier.

Signed-off-by: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1970
</content>
</entry>
<entry>
<title>Switch ztest mmap(2) ASSERTs to VERIFYs</title>
<updated>2014-03-12T16:05:00Z</updated>
<author>
<name>Richard Yao</name>
<email>ryao@gentoo.org</email>
</author>
<published>2013-12-26T20:51:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=202619623022722f30c2ee49931a4fa6896421c7'/>
<id>urn:sha1:202619623022722f30c2ee49931a4fa6896421c7</id>
<content type='text'>
This is just a small bit of cleanup to ensure ztest fails early
on systems where mmap(2) is not functioning.  For the automated
testing which is the primary consumer of ztest there is no
functional change because debugging is always enabled.

Signed-off-by: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #2177
</content>
</entry>
<entry>
<title>Free props in ztest_init()</title>
<updated>2014-03-12T16:01:48Z</updated>
<author>
<name>Richard Yao</name>
<email>ryao@gentoo.org</email>
</author>
<published>2014-01-21T01:30:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=85802aa42bf8f878022ec73ddde6bf3702f67d01'/>
<id>urn:sha1:85802aa42bf8f878022ec73ddde6bf3702f67d01</id>
<content type='text'>
Valgrind complained about this and it's absolutely right.  The
props nvlist was not being freed in ztest_init.

Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Signed-off-by: Richard Yao &lt;ryao@gentoo.org&gt;
Closes #2174
</content>
</entry>
<entry>
<title>cstyle: Resolve C style issues</title>
<updated>2013-12-19T00:46:35Z</updated>
<author>
<name>Michael Kjorling</name>
<email>michael@kjorling.se</email>
</author>
<published>2013-11-01T19:26:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d1d7e2689db9e03f11c069ebc9f1ba12829e5dac'/>
<id>urn:sha1:d1d7e2689db9e03f11c069ebc9f1ba12829e5dac</id>
<content type='text'>
The vast majority of these changes are in Linux specific code.
They are the result of not having an automated style checker to
validate the code when it was originally written.  Others were
caused when the common code was slightly adjusted for Linux.

This patch contains no functional changes.  It only refreshes
the code to conform to style guide.

Everyone submitting patches for inclusion upstream should now
run 'make checkstyle' and resolve any warning prior to opening
a pull request.  The automated builders have been updated to
fail a build if when 'make checkstyle' detects an issue.

Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1821
</content>
</entry>
<entry>
<title>Add missing libzfs_core to Makefiles</title>
<updated>2013-11-20T23:44:15Z</updated>
<author>
<name>Maximilian Mehnert</name>
<email>maximilian.mehnert@gmx.de</email>
</author>
<published>2013-11-17T10:47:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=539defc873dd1b53d7fc483947e56cbfaeebeee8'/>
<id>urn:sha1:539defc873dd1b53d7fc483947e56cbfaeebeee8</id>
<content type='text'>
On some platforms symbols provided by libzfs_core and used by
libzfs were not available to the linker.  To avoid this issue
libzfs_core has been added to the list of required libraries
when building utilities which depend on libzfs.  This should
have been handled properly by libtool and it's still not
entirely clear why it wasn't on all platforms.

Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Closes #1841
</content>
</entry>
<entry>
<title>Illumos #3956, #3957, #3958, #3959, #3960, #3961, #3962</title>
<updated>2013-11-05T20:23:05Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-08-07T20:16:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5d1f7fb647e8923d154901ef3e19676e7bf3d345'/>
<id>urn:sha1:5d1f7fb647e8923d154901ef3e19676e7bf3d345</id>
<content type='text'>
3956 ::vdev -r should work with pipelines
3957 ztest should update the cachefile before killing itself
3958 multiple scans can lead to partial resilvering
3959 ddt entries are not always resilvered
3960 dsl_scan can skip over dedup-ed blocks if physical birth != logical birth
3961 freed gang blocks are not resilvered and can cause pool to suspend
3962 ztest should print out zfs debug buffer before exiting
Reviewed by: Matthew Ahrens &lt;mahrens@delphix.com&gt;
Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Approved by: Richard Lowe &lt;richlowe@richlowe.net&gt;

References:
  https://www.illumos.org/issues/3956
  https://www.illumos.org/issues/3957
  https://www.illumos.org/issues/3958
  https://www.illumos.org/issues/3959
  https://www.illumos.org/issues/3960
  https://www.illumos.org/issues/3961
  https://www.illumos.org/issues/3962
  illumos/illumos-gate@b4952e17e8858d3225793b28788278de9fe6038d

Ported-by: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;

Porting notes:

1. zfs_dbgmsg_print() is only used in userland. Since we do not have
   mdb on Linux, it does not make sense to make it available in the
   kernel. This means that a build failure will occur if any future
   kernel patch depends on it. However, that is unlikely given that
   this functionality was added to support zdb.

2. zfs_dbgmsg_print() is only invoked for -VVV or greater log levels.
   This preserves the existing behavior of minimal noise when running
   with -V, and -VV.

3. In vdev_config_generate() the call to nvlist_alloc() was not
   changed to fnvlist_alloc() because we must pass KM_PUSHPAGE in
   the txg_sync context.
</content>
</entry>
<entry>
<title>Illumos #3949, #3950, #3952, #3953</title>
<updated>2013-11-05T20:17:07Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-08-07T18:24:34Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=621dd7bb2c970838bcf2226ac365c517af7a4bb1'/>
<id>urn:sha1:621dd7bb2c970838bcf2226ac365c517af7a4bb1</id>
<content type='text'>
3949 ztest fault injection should avoid resilvering devices
3950 ztest: deadman fires when we're doing a scan
3951 ztest hang when running dedup test
3952 ztest: ztest_reguid test and ztest_fault_inject don't place nice together
Reviewed by: Matthew Ahrens &lt;mahrens@delphix.com&gt;
Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Approved by: Richard Lowe &lt;richlowe@richlowe.net&gt;

References:
  https://www.illumos.org/issues/3949
  https://www.illumos.org/issues/3950
  https://www.illumos.org/issues/3951
  https://www.illumos.org/issues/3952
  illumos/illumos-gate@2c1e2b44148432fb7a509dd216a99299b6740250

Ported-by: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Issue #1775

Porting notes:

1. The deadman thread was removed from ztest during the original
   port because it depended on Solaris thr_create() interface.
   This functionality should be reintroduced using the more
   portable pthreads.
</content>
</entry>
<entry>
<title>Illumos #3955</title>
<updated>2013-11-05T20:16:14Z</updated>
<author>
<name>Matthew Ahrens</name>
<email>mahrens@delphix.com</email>
</author>
<published>2013-08-07T18:32:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=383fc4a9970ede483dc4bd7579f1c62942d1312f'/>
<id>urn:sha1:383fc4a9970ede483dc4bd7579f1c62942d1312f</id>
<content type='text'>
3955 ztest failure: assertion refcount_count(&amp;tx-&gt;tx_space_written) +
     delta &lt;= tx-&gt;tx_space_towrite
Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Dan Kimmel &lt;dan.kimmel@delphix.com&gt;
Reviewed by: George Wilson &lt;george.wilson@delphix.com&gt;
Approved by: Richard Lowe &lt;richlowe@richlowe.net&gt;

References:
  https://www.illumos.org/issues/3955
  illumos/illumos-gate@be9000cc677e0a8d04e5be45c61d7370fc8c7b54

Ported-by: Richard Yao &lt;ryao@gentoo.org&gt;
Signed-off-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Issue #1775
</content>
</entry>
<entry>
<title>Illumos #3112, #3113, #3114</title>
<updated>2013-11-05T20:14:48Z</updated>
<author>
<name>Matthew Ahrens</name>
<email>mahrens@delphix.com</email>
</author>
<published>2013-05-16T21:18:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=498877baf5038b32c1531e5ec96b435023200f4d'/>
<id>urn:sha1:498877baf5038b32c1531e5ec96b435023200f4d</id>
<content type='text'>
3112 ztest does not honor ZFS_DEBUG
3113 ztest should use watchpoints to protect frozen arc bufs
3114 some leaked nvlists in zfsdev_ioctl

Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Matt Amdur &lt;Matt.Amdur@delphix.com&gt;
Reviewed by: George Wilson &lt;george.wilson@delphix.com&gt;
Reviewed by: Christopher Siden &lt;chris.siden@delphix.com&gt;
Approved by: Eric Schrock &lt;eric.schrock@delphix.com&gt;

References:
  https://www.illumos.org/issues/3112
  https://www.illumos.org/issues/3113
  https://www.illumos.org/issues/3114
  illumos/illumos-gate@cd1c8b85eb30b568e9816221430c479ace7a559d

The /proc/self/cmd watchpoint interface is specific to Solaris.
Therefore, the #3113 implementation was reworked to use the more
portable mprotect(2) system call.  When the pages are watched they
are marked read-only for protection.  Any write to the protected
address range immediately trigger a SIGSEGV.  The pages are marked
writable again when they are unwatched.

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Issue #1489
</content>
</entry>
<entry>
<title>Illumos #3236</title>
<updated>2013-11-05T20:14:21Z</updated>
<author>
<name>George Wilson</name>
<email>george.wilson@delphix.com</email>
</author>
<published>2013-05-10T19:47:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=03c6040bee6c87a9413b7da41d9f580f79a8ab62'/>
<id>urn:sha1:03c6040bee6c87a9413b7da41d9f580f79a8ab62</id>
<content type='text'>
3236 zio nop-write
Reviewed by: Matt Ahrens &lt;matthew.ahrens@delphix.com&gt;
Reviewed by: Adam Leventhal &lt;ahl@delphix.com&gt;
Reviewed by: Christopher Siden &lt;chris.siden@delphix.com&gt;
Approved by: Garrett D'Amore &lt;garrett@damore.org&gt;

References:
  illumos/illumos-gate@80901aea8e78a2c20751f61f01bebd1d5b5c2ba5
  https://www.illumos.org/issues/3236

Porting Notes

1. This patch is being merged dispite an increased instance of
   https://www.illumos.org/issues/3113 being triggered by ztest.

Ported-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Issue #1489
</content>
</entry>
</feed>
